start copy from cimac web
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
<title>Esempio minimo</title>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="../fpdf.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Esempio minimo</h1>
|
||||
|
||||
Cominciamo con un esempio classico:
|
||||
|
||||
<div class="source">
|
||||
|
||||
<pre><code><?php
|
||||
|
||||
<span class="kw">require(</span><span class="str">'fpdf.php'</span><span class="kw">);
|
||||
|
||||
|
||||
|
||||
</span>$pdf <span class="kw">= new </span>FPDF<span class="kw">();
|
||||
|
||||
</span>$pdf<span class="kw">-></span>AddPage<span class="kw">();
|
||||
|
||||
</span>$pdf<span class="kw">-></span>SetFont<span class="kw">(</span><span class="str">'Arial'</span><span class="kw">,</span><span class="str">'B'</span><span class="kw">,</span>16<span class="kw">);
|
||||
|
||||
</span>$pdf<span class="kw">-></span>Cell<span class="kw">(</span>40<span class="kw">,</span>10<span class="kw">,</span><span class="str">'Hello World!'</span><span class="kw">);
|
||||
|
||||
</span>$pdf<span class="kw">-></span>Output<span class="kw">();
|
||||
|
||||
</span>?></code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<p class='demo'><a href='tuto1.php' target='_blank' class='demo'>[Demo]</a></p>
|
||||
|
||||
Dopo aver incluso la libreria, creiamo un oggetto FPDF.
|
||||
|
||||
Il <a href='../doc/__construct.htm'>costruttore</a> viene usato, qui sopra, con i valori di default:
|
||||
|
||||
le pagine sono formato A4, verticale, e con unità di misura in
|
||||
|
||||
millimetri. Sarebbe possibile specificarli esplicitamente con:
|
||||
|
||||
<div class="source">
|
||||
|
||||
<pre><code>$pdf <span class="kw">= new </span>FPDF<span class="kw">(</span><span class="str">'P'</span><span class="kw">,</span><span class="str">'mm'</span><span class="kw">,</span><span class="str">'A4'</span><span class="kw">);
|
||||
|
||||
</span></code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
E' possibile usare il formato orrizzontale (<code>L</code>), altri tipi di formati (come <code>A3</code>
|
||||
|
||||
e <code>A5</code>) e unità di misura (<code>pt</code>, <code>cm</code>, <code>in</code>).
|
||||
|
||||
<br>
|
||||
|
||||
<br>
|
||||
|
||||
Per il momento non ci sono altri formato pagina. Dobbiamo aggiungerlo con <a href='../doc/addpage.htm'>AddPage()</a>. L'origine
|
||||
|
||||
è all'angolo superiore-sinistro e la posizione attuale è messa per difetto a 1 cm dai confini; i
|
||||
|
||||
margini possono essere cambiati con <a href='../doc/setmargins.htm'>SetMargins()</a>.
|
||||
|
||||
<br>
|
||||
|
||||
<br>
|
||||
|
||||
Prima che si possa stampare il testo, è obbligatorio selezionare una fonte con <a href='../doc/setfont.htm'>SetFont()</a>.
|
||||
|
||||
Reference in New Issue
Block a user