require('fpdf.php');
class PDF extends FPDF
{
//Page header
function Header()
{
//Logo
$this->Image('logo.png',20,10,20,20);
//Arial bold 15
$this->SetFont('Arial','B',15);
//Move to the right
$this->Cell(70);
//Setting the text in the centre 'C'
$this->Cell(50,10,'Generating PDF',0,0,'C');
//Line break
$this->Ln(20);
}
}
//Instanciation of inherited class
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','',12);
for($i=1;$i<=10;$i++)
// printing a text center aligned.
$pdf->Cell(100,10,'Printing line number '.$i,0,1,'C');
$pdf->Output();
?>