查看了这个项目的官方demo,效果还不是很满意。持续关注中
http://andreasgal.com/2011/06/15/pdf-js/
Why?
While traveling to the Firefox 4 launch parties in Seoul and Taipei all the way from California, we killed a lot of time by brainstorming cool things to do with the web platform. Like many before us, we were wondering why nobody had implemented a PDF reader in HTML5/JavaScript. The kinds of operations a PDF reader needs to be fast at –render text, draw lines, blit images– need to be fast in browsers too, so browsers are already highly optimized for them.
Building an HTML5-based PDF renderer would also answer the question of whether the web platform and in particular canvas and SVG APIs are complete enough to efficiently and faithfully render PDFs.
Displaying PDFs directly in the browser would definitely improve the user’s experience. There are literally millions (billions?) of PDFs floating around the web, and on many devices loading PDFs switches to a different application (e.g. Preview on OS X and PDF View on Android). Also, external PDF readers and many plugins don’t support important PDF features well, including content links and fetch-as-you-go (HTTP range requests).
External readers and plugins are also forced to reinvent their own user interaction paradigms, meaning for example that users might scroll HTML pages in one way with one set of heuristics in the browser, but a totally different way in an external PDF reader.
It’s important to note that we’re not trying to promote PDF to a first-class web citizen like HTML5 is. Instead we hope that a browser-native PDF renderer written on the web platform allows web technologies to subsume PDF.
Benefits
The traditional approach to rendering PDFs in a browser is to use a native-code plugin, either Adobe’s own PDF Reader or other commercial renderers, or some open source alternative (e.g. poppler). From a security perspective, this enlarges the trusted code base, and because of that Google’s Chrome browser goes through quite some pain to sandbox the PDF renderer to avoid code injection attacks. An HTML5-based implementation is completely immune to this class of problems.
分享到:
相关推荐
pdf.js和pdf.worker.js html打开pdf所需要的js demo:http://www.cnblogs.com/zt-zoro/articles/7156120.html
pdf.js , pdf.worker.js。将两者放在同一文件夹下,在html页面中用src引入pdf.js就可以了。
pdf.js 是一个技术原型主要用于在 HTML5 平台上展示 PDF 文档,无需任何本地技术支持。pdf.js是一个HTML5技术的实验,探索实现一个没有本地代码支持,有效率的PDF渲染。 pdf.js是社区驱动和Mozilla Labs的支持。我们...
viewer.js,pdf.js,pdf.worker.js,viewer.min.css前端展示图片/Pdf
不想给积分的留下邮箱 或者直接去pdf.js 官网下载 不要浪费积分了
前端预览pdf pdf.js中代码文件pdf.worker.js,文件过大,可修改web/viewer.js中的workerSrc路径,改为对应版本地址
采用最新版本pdf.js 结合SpringBoot预览pdf文件。 pdf.js可以去官网下载最新,也可以使用工程内资源。 本工程自带pdf文件,详情请查阅工程目录。
pdf.js 文件 最新版本
小程序预览PDF文件插件Pdf.js,在Uniapp中使用pdf.js实现PDF预览
前端项目-html2pdf.js,使用纯JS的客户端HTML到PDF呈现
PDF.js在线批注实现(附源码) JS+HTML5实现
turn.js+pdf.js资源
pdf.js 手机端或H5显示pdf
一个通过pdf.js读取pdf文件的测试实例
pdf.js的源码通过gulp generic打包生成后,直接可以在web项目中使用的文件。
使用pdf.js实现pdf文件的跨域预览,代码比较简答,仅作参考使用。该项目是Idea搭建的springboot工程。
java集成pdf.js 在线阅览pdf文件 java集成pdf.js 在线阅览pdf文件
网上大部分pdf.js都是用url方式预览pdf,此处给出pdf.js使用文件流预览pdf的Web工程; 此是maven工程; 100%能运行;