php 开源 Web PDF 查看器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2833949/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Open Source Web PDF Viewer?
提问by Nitz
Is their any Open Source Web PDF Viewer?
Which has good api through which I can modify the looks of the viewer?
I had tried the Scribd, Google Docs, FlexPaper , and thisalso.
But it is not giving me, as I want.
Then i had downloaded the shadowboxbut it has not given me information about how to use it?
So anyone know good web pdf viewer and it would be great if it offers the customization
And that should be great if it is in php.
Thanks in advance...
他们有任何开源 Web PDF 查看器吗?
哪个有很好的api,我可以通过它来修改查看器的外观?
我曾尝试过 Scribd、Google Docs、FlexPaper,还有这个。
但它没有给我,如我所愿。
然后我下载了shadowbox,但它没有给我有关如何使用它的信息?
所以任何人都知道好的 web pdf 查看器,如果它提供自定义功能
会很棒,如果它是在 php 中应该很棒。
提前致谢...
回答by Jimmy Sawczuk
I don't think you're going to find a PDF viewer that's in PHP. The decoding of the PDF format happens on the client, which means your only options are either relying on the client to do the decoding work for you (Adobe Reader, Google Chrome's built-in reader, OS X's Preview app, etc.), rendering it with Javascript, or figuring out some way to convert the PDF into HTML.
我认为您不会找到使用 PHP 编写的 PDF 查看器。PDF 格式的解码发生在客户端,这意味着您唯一的选择是依赖客户端为您完成解码工作(Adobe Reader、Google Chrome 的内置阅读器、OS X 的预览应用程序等)、渲染它使用 Javascript,或者想办法将 PDF 转换为 HTML。
PDFs are so ubiquitous these days, that it doesn't make a whole lot of sense to me to want to try to render it for a client; rather, simply tell them that the file they're downloading is a PDF and offer links to either Chromeor Adobe Reader, and let the user view the PDF in whatever app they please.
现在 PDF 是如此普遍,以至于我想尝试为客户呈现它并没有多大意义;相反,只需告诉他们他们正在下载的文件是 PDF 并提供指向Chrome或Adobe Reader 的链接,并让用户在他们喜欢的任何应用程序中查看 PDF。
回答by esafwan
There is a wonderful pdf viewer which is opensource too. The ui implementation is basic. You will have to work on it. But its awesome.
有一个很棒的 pdf 查看器,它也是开源的。ui 实现是基本的。你将不得不为此努力。但它太棒了。
回答by Jamie Carl
There is also a project from Mozilla called PDF.js. They're hoping to get it to a point where it's available as part of Firefox.
还有一个来自 Mozilla 的名为 PDF.js 的项目。他们希望能够将其作为 Firefox 的一部分提供。
Get it at: http://mozilla.github.com/pdf.js/
获取它:http: //mozilla.github.com/pdf.js/
I've tried it out myself and it works very well. The only issue is the source JS files are about 1.4mb which is rather large and I couldn't minify them due to some weird coding standards.
我自己试过了,效果很好。唯一的问题是源 JS 文件大约 1.4mb,相当大,由于一些奇怪的编码标准,我无法缩小它们。

