Does anyone know of any software (preferably open source, Linux or PHP) that can convert both PDF and/or DOC/DOCX (and maybe other document formats too: rtf, txt, etc.) to HTML?

I've got "PDFtoHTML" software working but this not appear to also convert DOC/DOCX files.

link|improve this question
feedback

migrated from stackoverflow.com Oct 28 '11 at 19:41

This question came from our site for professional and enthusiast programmers.

3 Answers

You should give unoconv a spin. It should be able to convert anything that Open Office can read to anything it can write.

This works on doc/docx and a whole lot of other files. It does not seem to work on PDF's so I guess you're stuck with using 2 separate programs for the job.

link|improve this answer
hi jpjacobs, thanks for the tip, i hadn't heard of unoconv, will give it a shot, thanks! -tim – tim peterson Oct 28 '11 at 14:10
feedback

I successfully put a portable version of libreoffice on my host's webserver, which I call with PHP to do a commandline conversion to .docx, etc. to pdf. on the fly. I do not have admin rights on my host's webserver. Here is my blog post of what I did:

http://geekswithblogs.net/robertphyatt/archive/2011/11/19/converting-.docx-to-pdf-or-.doc-to-pdf-or-.doc.aspx

Yay! Convert directly from .docx or .odt to .pdf using PHP with LibreOffice (OpenOffice's successor)!

link|improve this answer
feedback

Have you tried PHPDocX? It allows you to do quite a few more things with docx files.

There is a generateXHTML method.

link|improve this answer
it looks like PHPDocX does makes .docx files but i'm looking for software that converts .docx files to HTML. Am i confused? – tim peterson May 8 at 8:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.