Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Convert Word file to HTML without losing styling and images [closed]

Tags:

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:

  • Converting MS Word document to html in php
like image 403
Herr Avatar asked Feb 21 '13 07:02

Herr


People also ask

How do I convert a Word document to HTML without losing formatting?

Using MS Words built-in save as HTML option Go to the file menu. Select Save as. In the drop-down file type box select, Web Page, Filtered. Click Save.

How do I convert a Word document to a JPEG without losing quality?

Click File > Export from the dropdown menu. Click on the format and select to save the document as a JPEG file. Use the slider to choose the JPEG quality. Click Save to confirm the conversion.


1 Answers

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.

like image 130
alexpls Avatar answered Sep 27 '22 19:09

alexpls