简体   繁体   English

嵌入pdf文件并使用PHP打印到打印机

[英]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). 我正在开发一个PHP / MySQL项目,该项目可以打印出每个人的详细信息的多个合同,并且在每个合同的末尾,我还想添加doc / pdf文件的内容(例如半页的公司手册) 。 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. 我需要pdf / doc才能在同一页面(作为页面的一部分)中进行打印,但是在动态数据之后,有点像在iframe中一样。 Any ideas? 有任何想法吗?

Embedding PDFs is flaky at best. 最多只能嵌入PDF。 I'm using this page's examples as a test: http://pdfobject.com/markup/index.php 我正在使用此页面的示例作为测试: http : //pdfobject.com/markup/index.php

In Chrome, it uses its native PDF viewer. 在Chrome浏览器中,它使用其本机PDF查看器。 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. 打印页面会在浏览器中捕获嵌入式PDF的屏幕快照,然后对其进行细分。结果是最终输出中的文本质量较差,而且有点不可预测,而且您无法控制PDF本身。

In IE9 and Firefox, they use whatever PDF viewer is available -- Adobe Acrobat Pro 9 in my case. 在IE9和Firefox中,他们使用任何可用的PDF查看器-就我而言是Adobe Acrobat Pro 9。 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. 这些浏览器毫不费力地尝试在打印时包含PDF,而是仅在应有的位置显示空白方块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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