如何在页面中嵌入 PDF 查看器? [英] How to embed a PDF viewer in a page?
本文介绍了如何在页面中嵌入 PDF 查看器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我没记错的话,Google Docs 提供了通过 显示与网页存储在同一服务器上的 PDF 的方法,但我需要知道如何我可以以跨浏览器兼容的方式执行此操作.
If I'm not mistaken, Google Docs offers the means to display a PDF that is stored on the same server as the web page via an <iframe>
, but I need to know how I can do this in a cross-browser compliant way.
推荐答案
您可以考虑使用 PDFObject菲利普·哈奇森.
You could consider using PDFObject by Philip Hutchison.
或者,如果您正在寻找非 Javascript 解决方案,您可以使用如下标记:
Alternatively, if you're looking for a non-Javascript solution, you could use markup like this:
<object data="myfile.pdf" type="application/pdf" width="100%" height="100%">
<p>Alternative text - include a link <a href="myfile.pdf">to the PDF!</a></p>
</object>
这篇关于如何在页面中嵌入 PDF 查看器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文