views:

103

answers:

2

I am using this site as reference: http://www.ros.co.nz/pdf/

I read the readme.pdf but haven't found any function that instructs how to add header and footers in every page in the pdf.

A: 

What about using dompdf:

NAVEED
anonymous123
A: 

You should be able to do this by opening an object, creating your content, closing the object, and then adding the object to your PDF. See pages 22-23 (PDF pages 25-26) of the reference you cited for the relevant documentation.

A brief example:

<?php
include ('class.ezpdf.php');
$pdf =& new Cezpdf();
$pdf->selectFont('fonts/Helvetica.afm');

$footer = $pdf->openObject();
$pdf->addText(50, 50, 8, "some footer text");
$pdf->line(50,60,562,60);
$pdf->closeObject();
$pdf->addObject($footer, "all");

$pdf->ezText('Hello World!',50);
$pdf->ezStream();
?>
BrianS