tags:

views:

6701

answers:

6

Has anyone found a good class, or other file that will convert a .doc file into html or something that I can read and turn into html?

I have been looking around for a couple hours now and have only found ones that require msword on the server in order to convert the file. I am pretty sure that is not an option but I have not actually talked to my hosting provider about it.

The goal is for a user to be able to upload the file to my server and the server handle the conversion and then display it as html, much like googles view as html feature.

A: 

A project called phpLiveDocx does what you want. It is a SOAP based service, but can be used free of charge. For a basic introduction, please see: http://www.phplivedocx.org/articles/brief-introduction-to-phplivedocx/

A: 

You can use Aspose.Words to convert DOC to HTML. But it comes either for .NET or Java. You will need to invoke it from PHP, for more see article http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/utilize-aspose-words-in-other-programming-languages.html

romeok
A: 

Install open office on your system and run this on the command line:

/usr/bin/soffice -headless "macro:///Standard.Convert.SaveAsHtml(test.doc)"

Anthony Tolman
A: 

intall and use abiword, like this:

AbiWord --to=html archivo.doc

you can call this command from php.

CronosNull