Location: PHPKode > scripts > PHP DataGrid > modules/fpdf/tutorial/tuto4.php

class PDF extends FPDF
//Current column
var $col=0;
//Ordinate of column start
var $y0;

function Header()
	//Page header
	global $title;

	//Save ordinate

function Footer()
	//Page footer
	$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');

function SetCol($col)
	//Set position at a given column

function AcceptPageBreak()
	//Method accepting or not automatic page break
		//Go to next column
		//Set ordinate to top
		//Keep on page
		return false;
		//Go back to first column
		//Page break
		return true;

function ChapterTitle($num,$label)
	$this->Cell(0,6,"Chapter  $num : $label",0,1,'L',1);
	//Save ordinate

function ChapterBody($fichier)
	//Read text file
	//Output text in a 6 cm width column
	$this->Cell(0,5,'(end of excerpt)');
	//Go back to first column

function PrintChapter($num,$title,$file)
	//Add chapter

$pdf=new PDF();
$title='20000 Leagues Under the Seas';
$pdf->SetAuthor('Jules Verne');
$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
Return current item: PHP DataGrid