pdf.js以外的任何选项,用于在所有浏览器中以编程方式显示PDF文件

时间:2017-08-25 15:47:40

标签: pdf

我正在开发基于JavaScript的应用程序,并且需要在浏览器中显示PDF文件。目前我正在使用并且即时嵌入PDF文件。这种方法适用于Firefox和Chrome,因为这些浏览器具有内置的pdf查看器,但它在Internet Explorer中不起作用。所以我正在寻找一个跨浏览器的解决方案,而不是pdf.js库。

1 个答案:

答案 0 :(得分:1)

There is no alternative to Mozilla's PDF.js -- the JavaScript cross-browser solution that allows fully parse and render PDF on the client/browser side. You can try compiling some C library to asm.js/WebAssembly (PDFium or Poppler), but you will only get rasterizer of a PDF page to a bitmap. PDF.js attempts to provide more things e.g. painting via canvas API or building DOM text layer for accessibility purposes.

All other JavaScript "viewers" have to have server side, or pre-process PDF before-hand into some other format e.g. PNG (which is technically is not a PDF anymore).