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

前端 未结 3 404
不知归路
不知归路 2020-12-21 22:45

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

相关标签:
3条回答
  • 2020-12-21 23:31

    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.

    0 讨论(0)
  • 2020-12-21 23:48

    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.

    0 讨论(0)
  • 2020-12-21 23:51

    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.

    0 讨论(0)
提交回复
热议问题