views:

71

answers:

2

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

A: 

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.

Diodeus
+1  A: 

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.

Richard June
I don't know php, but presumably you can execute/call a shell script from within php (and capture the output), so that would probably work
Richard
Absolutely you can do that, which is why I brought it up, I'm not sure that google will let him easily do what he wants.
Richard June
excellent solution, thanks!
Joaquín L. Robles