本文介绍了在HTML5中嵌入PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在HTML文档中嵌入PDF,但这似乎只适用于Chrome。其他浏览器似乎需要插件或需要用户点击不是我想要的链接。这里是我所尝试过的:
I am trying to embed a PDF in an HTML document, but this seems to work only with Chrome. Other browsers appear to either require plugins or require a user to click a link which is not what I want. Here is what I have tried:
<object data="pdfFiles/interfaces.pdf" type="application/pdf">
<embed src=" pdfFiles/interfaces.pdf" type="application/pdf"> </embed>
alt :<a href="pdfFiles/interfaces.pdf">
</object>
推荐答案
以下是您可以用于每个浏览器的代码:
Here is the code you can use for every browser:
<embed src="pdfFiles/interfaces.pdf" width="600" height="500" alt="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">
在Firefox和Chrome上测试
Tested on firefox and chrome
这篇关于在HTML5中嵌入PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!