简体   繁体   English

使用PDF.js将PDF静态转换为HTML

[英]Use PDF.js to statically convert a PDF to HTML

PDF.js is the latest library from Mozilla, and is a standards-based PDF renderer that is written entirely in Javascript. PDF.js是Mozilla的最新库,是一个基于标准的PDF渲染器,完全用Javascript编写。 Currently you cannot access the generated HTML, and the library can only be used as a viewer. 目前,您无法访问生成的HTML,并且该库只能用作查看器。 Is it possible to use PDF.js to statically convert a PDF to its HTML equivalent? 是否可以使用PDF.js将PDF静态转换为其HTML等价物? Considering it renders in a browser, it must be HTML+CSS, and the JS would be used only for navigation. 考虑到它在浏览器中渲染,它必须是HTML + CSS,而JS只能用于导航。

After converting it to HTML I plan to use our existing HTML workflow to import/index/consume the page as if it were an ordinary HTML webpage. 在将其转换为HTML后,我计划使用现有的HTML工作流来导入/索引/使用页面,就像它是普通的HTML网页一样。

Note: this is for the original question, as well as for others who may be visiting this for related help, as was the case with me. 注意:这是针对原始问题的,以及可能正在访问此相关帮助的其他人,就像我的情况一样。 ;) ;)

Answer: 回答:
You may try: Poppler or pdf2htmlEX which is based on Poppler. 您可以尝试: Popplerpdf2htmlEX ,它基于Poppler。

I'd recommend looking at the pdf2htmlEX documentation it also has as very good comparison table . 我建议查看pdf2htmlEX文档,它也有非常好的比较表

pdf.js呈现给Canvas,因此不能用于将PDF静态转换为HTML

DocPub is powered by PDFNet , a PDF SDK with C# support, which supports converting PDF to HTML offline. DocPubPDFNet提供支持,这是一个支持C#的PDF SDK,支持将PDF转换为HTML脱机。

WebViewer from the same company is an HTML5-based PDF viewer that renders documents on-the-fly within the browser. 来自同一家公司的WebViewer是一个基于HTML5的PDF查看器,可以在浏览器中即时呈现文档。

WebViewer works with all major Web platforms; WebViewer适用于所有主要的Web平台; the viewer can be directly embedded and customized within any HTML5, Silverlight, or Flash application. 可以在任何HTML5,Silverlight或Flash应用程序中直接嵌入和自定义查看器。 The content can be instantly accessed from any system or device - including iPad/iPhone (iOS), Android, Windows (desktop & tablets), WP8, Linux, Mac, etc. -- demo 可以从任何系统或设备即时访问内容 - 包括iPad / iPhone(iOS),Android,Windows(桌面和平板电脑),WP8,Linux,Mac等。 - 演示

AccuSoft has an HTML5-based PDF/DOC viewer called Prizm . AccuSoft有一个名为Prizm的基于HTML5的PDF / DOC查看器。 I don't think this can convert the PDF statically to HTML, but it looks like a functional HTML5-based viewer. 我不认为这可以将PDF静态转换为HTML,但它看起来像一个基于HTML5的功能查看器。 I have no experience with it, but the online HTML5 demo (the link) looks pretty impressive. 我没有经验,但在线HTML5演示(链接)看起来非常令人印象深刻。 They claim it can be used on PC & Mobile for great rendering of such files. 他们声称它可以在PC和Mobile上使用,以便很好地渲染这些文件。

Accusoft HTML5 viewing technology can display virtually any document file—DOC, PDF, PPT, CAD and dozens more—through the native browser on almost any smartphone or tablet, with no additional apps or players required on users' devices. Accusoft HTML5查看技术几乎可以在几乎任何智能手机或平板电脑上通过本机浏览器显示几乎任何文档文件-DOC,PDF,PPT,CAD等等,用户设备上无需其他应用程序或播放器。

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

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