21

Is there an API for converting word files to HTML without losing the format?

Can the google documents API be used for this?

I tried saaspose but the returning result is always a server error.

Solutions that did not work for me:

Community
  • 1
  • 1
Herr
  • 2,725
  • 3
  • 30
  • 36

2 Answers2

11

I've spent a bit of time loking into this, and the best solution that I've found was to install unoconv on the server, and using PHP to interface with it through system calls.

I would have loved to find a good native PHP solution for this, but unfortunately I couldn't.

Edit Since originally answering this, I've come across a web service which presents an API for converting documents. I haven't tested it very thoroughly but it does seem to produce decent results at converting Word to HTML: CloudConvert.

alexpls
  • 1,914
  • 20
  • 29
0

PHPDocx has a solution. According to site you may extract data directly from any database or spreadsheet and export them to other popular formats (PDF, DOC, HTML, ODT, ...) with the help of the conversion plugin. These reports may include editable graphs (only docx), images, tables, headers, footers, etcetera.

Am not sure how good it can convert word to html

krishna
  • 930
  • 1
  • 16
  • 35
  • 2
    You're right - PHPDocx should work for this. Unfortunately you'll need to buy a license in order to get the PHPDocx version that allows DOC/X to HTML. – alexpls Oct 23 '13 at 02:42