简体   繁体   English

将多页pdf文件显示为html中的单页文件

[英]display multi-page pdf file as single page files in html

I have a pdf file embedded in a HTML document. 我在HTML文档中嵌入了一个pdf文件。 Is it possible to display a multi-page pdf file as multiple single page files in html? 是否可以将多页pdf文件显示为html中的多个单页文件? Something similar to a ppt where each page of the pdf doc is equivalent to a slide. 类似于ppt,其中pdf文档的每一页都相当于一张幻灯片。

Thanks in Advance! 提前致谢!

You can also use Google PDF viewer for this purpose. 您也可以为此使用Google PDF查看器。 As far as I know it's not an official Google feature (am I wrong on this?), but it works for me very nicely and smoothly. 据我所知,这不是Google的正式功能(我对这个功能有误吗?),但它对我非常顺利。 You need to upload your PDF somewhere before and just use its URL: 您需要先上传PDF,然后再使用其URL:

<iframe src="http://docs.google.com/gview?url=http://example.com/mypdf.pdf&embedded=true" style="width:718px; height:700px;" frameborder="0"></iframe>

Probably the best approach is to use the PDF.JS library. 最好的方法可能是使用PDF.JS库。 It's a pure HTML5/JavaScript renderer for PDF documents without any third-party plugins. 它是用于PDF文档的纯HTML5 / JavaScript渲染器,没有任何第三方插件。

Online demo: http://mozilla.github.com/pdf.js/web/viewer.html 在线演示: http : //mozilla.github.com/pdf.js/web/viewer.html

GitHub: https://github.com/mozilla/pdf.js GitHub: https : //github.com/mozilla/pdf.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM