source: trunk/client/inc/hpdf/_fpdf/tutorial/tuto2.php@ 2

Last change on this file since 2 was 2, checked in by root, 15 years ago

importo il progetto

File size: 773 bytes
Line 
1<?php
2require('../fpdf.php');
3
4class PDF extends FPDF
5{
6//Page header
7function Header()
8{
9 //Logo
10 $this->Image('logo_pb.png',10,8,33);
11 //Arial bold 15
12 $this->SetFont('Arial','B',15);
13 //Move to the right
14 $this->Cell(80);
15 //Title
16 $this->Cell(30,10,'Title',1,0,'C');
17 //Line break
18 $this->Ln(20);
19}
20
21//Page footer
22function Footer()
23{
24 //Position at 1.5 cm from bottom
25 $this->SetY(-15);
26 //Arial italic 8
27 $this->SetFont('Arial','I',8);
28 //Page number
29 $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
30}
31}
32
33//Instanciation of inherited class
34$pdf=new PDF();
35$pdf->AliasNbPages();
36$pdf->AddPage();
37$pdf->SetFont('Times','',12);
38for($i=1;$i<=40;$i++)
39 $pdf->Cell(0,10,'Printing line number '.$i,0,1);
40$pdf->Output();
41?>
Note: See TracBrowser for help on using the repository browser.