<?php
require('fpdf.php');
class PDF extends FPDF
{
// Page header
function Header()
{
// GFG logo image
$this->Image('geeks.png', 30, 8, 20);
// GFG logo image
$this->Image('geeks.png', 160, 8, 20);
// Set font-family and font-size
$this->SetFont('Times','B',20);
// Move to the right
$this->Cell(80);
// Set the title of pages.
$this->Cell(30, 20, 'Welcome to GeeksforGeeks', 0, 2, 'C');
// Break line with given space
$this->Ln(5);
}
// Page footer
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Set font-family and font-size of footer.
$this->SetFont('Arial', 'I', 8);
// set page number
$this->Cell(0, 10, 'Page ' . $this->PageNo() .
'/{nb}', 0, 0, 'C');
}
}
// Create new object.
$pdf = new PDF();
$pdf->AliasNbPages();
// Add new pages
$pdf->AddPage();
// Set font-family and font-size.
$pdf->SetFont('Times','',12);
// Loop to display line number content
for($i = 0; $i < 50; $i++)
$pdf->Cell(30, 10, 'Line Number ' . $i, 0, 2, 'L');
$pdf->Output();
?>