Chris Rockwell
Chris Rockwell

Reputation: 1842

Is fpdi shrinking template and/or adding whitespace?

Using FPDI, I first use a template to create a table of contents. I then import additional pages, which are linked to by the table of contents. What I'm experiencing is that FPDI is shrinking the templates and possible adding white space. I believe I have eliminated any browser added whitespace/shrinkage by merging the same documents into one via the passthru() command.

I have pasted code here: http://pastebin.com/VeLEN8nz. Line 45 - 57 is where the Table of Contents gets included as a template file.

The original file is here: http://truckingshow.com/TOC.pdf The post-FPDI file is here: http://truckingshow.com/TOC-afterFPDI.pdf

The most noticeable difference is in the right and bottom margins.

Thank you for taking a look, please let me know if I can provide more info.

Upvotes: 0

Views: 631

Answers (1)

Chris Rockwell
Chris Rockwell

Reputation: 1842

The document that was given to me was "Letter", not "A4" (the default for FPDF())

Instead of $pdf = new FPDI('P', 'pt') Simply using $pdf = new FPDI('P', 'pt', 'Letter') solved the problem.

Thanks!

Upvotes: 2

Related Questions