How can I convert PDF to HTML?

南笙酒味 提交于 2019-11-28 16:23:55

PDFBox at apache has an html extraction capability. http://pdfbox.apache.org/

If you are working on a Windows box, I think Amyuni has a library for this as well. Their PDF Document Convertor is accessible as a DLL, can be used widely among the languages supported by Visual Studio, and can convert to RTF, TML, EXCEL, JPEG, and TIFF.

http://www.lowagie.com/iText/ Opensource library for both Java and C#

The pdftohtml program converts pdf to html and xml and preserves position information of the text which is helpful for scraping tables..

It seems to be based on the xpdf library and has a windows binary, too.

In linux install pdftohtml - For batch convertion of all files in a folder use:

ls *.pdf | xargs -I{} pdftohtml {}

This will create html site with all references and images from original documents. Every page in a separate html file. Very useful to convert project documentation to search for files by phrase, using common system file search.

Ether

In Perl, you can use the SWISH::Filter plugin SWISH::Filters::Pdf2HTML. (It requires the xpdf package.)

For the reverse (HTML to PDF), see this question.

if you're looking for a way to convert PDF to HTML once or twice then I recommend Adobe Online Conversion

If it's an API you're after then http://www.pdfonline.com/ has an SDK that should suit your needs.

If it's a library you're after then please let us know which server-side language you prefer.

Given the vagueness of the original question I'm going to go ahead and give a solution that will work with any language that can execute command-line apps. Although it can be a little bit tricky to get setup, OpenOffice can be run in headless mode on a server and, with the help of jodconverter, can convert any file format to any other file format (well, any format conversions that openoffice can handle, that is).

Here are a couple of links that help with the setup:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!