简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM