用于在浏览器中呈现和注释PDF文档的Html5组件?

use*_*891 17 javascript pdf html5 postscript

我正在尝试构建一个webapp,可以在没有安装Flash播放器的浏览器中查看和注释PDF文件(如iPad).是否有任何免费或廉价的组件在HTML,JS和画布中呈现PDF?谢谢!

jsb*_*eno 6

不是我知道的.(我假设你用Google搜索,所以我正在跳过它).这显然是网络上的缺失 - (我在这里找到了一个玩具实现:http://ajaxian.com/archives/wps-postscript-and-pdf-interpreter-for-html-5-canvas - 但它是现在只是一个玩具).

一个严肃的产品可以使用像http://code.google.com/p/emscripten/这样的项目来调整Ghostscript本身的Javascript ,它可以将C代码编译为LLVM,然后编译为javascript.在这里运行的javascript中有一个完整的Python解释器示例:http: //syntensity.com/static/python.html

当然它不会是微不足道的,无论如何都需要编写canvas和UI的输出部分.我认为它现在不适合你的需求,但我在这里写,所以也许有人可以做到这一点.

同时,您可以考虑运行Ghostscript(http://pages.cs.wisc.edu/~ghost/doc/intro.htm)服务器端,并将预渲染的PNG图像传送到浏览器.这将更容易做到,虽然它需要大量的服务器果汁.

  • [当前`emscripten`端口的维基列表](https://github.com/kripken/emscripten/wiki/Porting-Examples-and-Demos) - 包括[hpdf.js](http://manuels.github.com /hpdf.js/),[Poppler](https://github.com/coolwanglu/emscripten/tree/master/tests/poppler),[PDFium.js](http://coolwanglu.github.io/PDFium. JS /).还有mozilla [pdf.js项目](https://mozilla.github.io/pdf.js/)在HTML画布上呈现 (2认同)

小智 5

我最近在寻找类似的东西:

pdf.js(由Andreas Gal @ mozilla以及其他公司开发)正在开发中,目标是直接使用HTML5和JavaScript呈现PDF。在github [ https://github.com/andreasgal/pdf.js ]

值得阅读公告和评论(140+)[ http://andreasgal.com/2011/06/15/pdf-js/ ]