如何在页面中嵌入PDF查看器? [英] How to embed a PDF viewer in a page?

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

问题描述

如果我没记错的话,Google Docs提供了一种显示方式,可以通过<iframe>显示与网页存储在同一服务器上的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屋!

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