html - 执行文件 -> 打印时嵌入 PDF 内容

标签 html internet-explorer pdf web printing

我有一个嵌入到标准 html 网页中的 PDF 文件。

<h3>Foo</h3>
<object  id="foo" data="bigboundingbox.pdf" 
				type="application/pdf" 
			   classid="clsid:CA8A9780-280D-11CF-A24D-444553540000"> </object>

这目前在 Internet Explorer 中呈现,使用 Windows 上的 Adob​​e Reader 插件。 Firefox 和 Chrome 似乎在使用它们内部的 PDF 渲染引擎。

在所有 3 种情况下,页面都显示了 PDF 内容上方可见的 Foo header 。

当用户尝试打印页面(文件 -> 打印)时,正在呈现的 PDF 不会显示在 Internet Explorer 或 Chrome 中生成的打印文档中。

Firefox 似乎可以正确显示。

  • 我已经尝试使用 PDFObject 来嵌入它并得到相同的结果
  • 还有其他帖子推荐使用 PDF.js 等。但是我必须支持 IE 7 IE 8 和 PDF.js 根本无法与 7 和与 8 的合作取得了有限的成功。

有谁知道为什么会发生这种情况,如果有什么我可以修改以便打印出来的?

最佳答案

您可以为此使用 fpdf。看看 fpdf here

关于html - 执行文件 -> 打印时嵌入 PDF 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29761988/

相关文章:

css - IE弄乱了图标的大小

javascript - Jquery 侧边栏在 IE 中不起作用

javascript - ParseFromString 在 IE 中抛出错误,但在 Chrome 中不会

html - PDF 内容重叠

pdf - 打印页面中包含 pdf 的 CSS

javascript - 使用javascript更改html中奇数/偶数DIV的颜色

html - 结合两个d3可视化

html - 使用 Google Docs API 生成 PDF

javascript - 结束 &lt;/script&gt; 标签会破坏脚本

java - 如何在java中将jsp页面保存为pdf?