如何在网页中嵌入PDF查看器? [英] How can I embed a PDF viewer in a web page?

查看:139
本文介绍了如何在网页中嵌入PDF查看器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我没有弄错,Google Docs提供了显示与网页通过iFrame存储在同一台服务器上的PDF的方法,但我需要知道如何在跨浏览器兼容的情况下执行此操作您可以考虑使用 或者,如果你正在寻找一个非Javascript解决方案,你可以像这样使用标记:

/ p>

 < object data =myfile.pdftype =application / pdfwidth =100%height =100 %> 
< p>替代文字 - 包含到PDF的连结< a href =myfile.pdf>< / a>< / p>
< / object>


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.

解决方案

You could consider using PDFObject by Philip Hutchison.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆