[nycphp-talk] FPDF/FPDI template size too small

David Mintz dmintz at
Fri Jun 30 15:59:39 EDT 2006

I am not sure what if anything you might be doing wrong, but a few months
ago I gnawed on the demo/example that ships with the Fpdi class until I
got it to open a PDF doc test_pdf.pdf and generate a new one using
test_pdf.pdf as a template, with some text inserted in a specific
position. (this is substantially the same snippet I put out here a few
weeks ago in response to another question, sorry for the redundancy). If I
remember correctly, the demo (before I hacked it up) explicitly resets the
dimensions -- you don't want to do that. HTH.

$pdf= new fpdi();
$tplidx = $pdf->ImportPage(1);
$pdf->Cell(150,20,'new text written '.date('r'));
$pdf->Cell(150,20,'more text written soon thereafter');

On Fri, 30 Jun 2006, Aaron Fischer wrote:

> Greetings,
> I am working with the FPDF and FPDI classes and have run into an issue.
>   When I import a pdf to use as a template it comes in smaller than it's
> original size.  I have specified the size of the template to be full
> page and set the margins for the pdf page to zero but the issue remains.
> Code excerpt:
> $pdf->SetMargins(0,0,0);
> $pdf->addPage();
> $pdf->useTemplate($tplidx,0,0,215.9,279.4);
> (Unit measurements 215.9 and 279.4 are in mm, equivalent to specifying
> 8.5 x 11 inches.)
> Has anyone working with the FPDI class noticed an issue with the
> template size?  Workarounds or suggestions?
> Thanks,
> -Aaron
> _______________________________________________
> New York PHP Community Talk Mailing List
> New York PHP Conference and Expo 2006
> Show Your Participation in New York PHP

David Mintz

Amendment IV

The right of the people to be secure in their
persons, houses, papers, and effects, against
unreasonable searches and seizures, shall not be
violated, and no Warrants shall issue, but upon
probable cause, supported by Oath or affirmation,
and particularly describing the place to be
searched, and the persons or things to be seized.

More information about the talk mailing list