How do I convert a PDF file to HTML in PHP?

坚强是说给别人听的谎言 提交于 2019-11-28 10:49:07

问题


How do I convert a PDF file to HTML in PHP? Is there any lib or web service? I mean free, thanks!


回答1:


Google pdf2html, pdftohtml looks to be the only viable one. and it's based on a command line program, not PHP. so it may not be useful to you. Google is capable of converting, so there may be a way to do it with GDocs as well. though I'm not sure of that. At any rate, I hope this gets you on the proper path at least.




回答2:


I've tried Poppler's pdftohtml command to convert PDF files to HTML files. Check it out on The HTML file output of Poppler is lighter when used but the output is not very accurate.

If you want accurate output you should use pdf2htmlEX I've converted complicated PDF files and got the best HTML output.




回答3:


You can't.

PDFs are complex documents containing embedded fonts, vector graphics and layout information that cannot be represented in HTML in an automated way. You may be able to extract the TEXT of the document, but that's about it.



来源:https://stackoverflow.com/questions/2403028/how-do-i-convert-a-pdf-file-to-html-in-php

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