Page 1 of 1

Display word .doc file content with php

Posted: Tue Nov 17, 2009 12:05 am
by winter2009
Is it possible to read word document content and display it on a webpage with php? I searched and found that COM can do this. But COM can only be used on windows server. I am using apache server now, is it possible to achieve this?

Thanks so much.

Re: Display word .doc file content with php

Posted: Tue Nov 17, 2009 2:11 am
by iankent
Is it a Word 97-2003 or Word 2007?

If its a 2007 (.docx) file then you can use gzip to uncompress and use PHP's XML functions to read the data and display as you like (getting it to display as Word displays it would be a bit trickier!)

If it's a 97-2003 (.doc) file then you're probably out of luck

Alternatively, you could convert your .doc/.docx files to RTF or HTML using Word and display those instead? HTML you could output as-is, and RTF is pretty well documented online.

hth

Re: Display word .doc file content with php

Posted: Tue Nov 17, 2009 3:39 am
by Eran
You can use a shell application such as AbiWord that converts the .doc file to a format you can work with.

Re: Display word .doc file content with php

Posted: Thu Sep 10, 2015 1:57 am
by Shellyyin
You can use google docs to display Word document content online. Or if you want this function works in some system, you can just use aceoffix.