bikey77
bikey77

Reputation: 6672

Embedding pdf file and printing to printer with PHP

I'm working on a PHP/MySQL project that prints out multiple contracts with each person's details and at the end of each contract, I would like to also add the contents of a doc/pdf file (like a half-page company brochure). I need the pdf/doc to print within the same page (as part of it) but after the dynamic data, sort of like in an iframe. Any ideas?

Upvotes: 0

Views: 1186

Answers (1)

zim2411
zim2411

Reputation: 628

Embedding PDFs is flaky at best. I'm using this page's examples as a test: http://pdfobject.com/markup/index.php

In Chrome, it uses its native PDF viewer. Printing the page results in the browser taking a screenshot of the embedded PDF, and subbing that in. The result is poor quality text in the final output, and it's a little unpredictable as well as you have no control over the PDF itself.

In IE9 and Firefox, they use whatever PDF viewer is available -- Adobe Acrobat Pro 9 in my case. These browsers make no effort whatsoever to try and include the PDF when printing, and instead just show a blank square where it should be.

Upvotes: 1

Related Questions