Anyone who is familiar with using FPDF to generate PDFs, I'd really appreciate some suggestions here:

I am using the following code, virtually identical to that used in the FPDF tutorial examples. But I keep getting a parse error for the first line containing the variable $this. In the tutorial they do not declare this variable prior to using it the same way as in the example below, but when I try and do this, it's a no go.

Any ideas? Suggestions?

the code

class PDF extends FPDF

function Header() {

    //Arial 12
    //Move to the right
    //Line break

function Footer()

    //Position at 1.5 cm from bottom
    //Arial italic 8
    //Page number
    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');

$pdf=new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times','',12); for($i=1;$i<=40;$i++) {     $pdf->Cell(0,10,'Printing line number '.$i,0,1); } $pdf->Output();


Nathan Mealey
Director of Operations
Cycle-Smart, Inc.
P.O. Box 1482
Northampton, MA
(413) 587-3133
(413) 210-7984 Mobile
(512) 681-7043 Fax

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to