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.
Display word .doc file content with php
Moderator: General Moderators
-
winter2009
- Forum Newbie
- Posts: 1
- Joined: Tue Nov 17, 2009 12:02 am
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: Display word .doc file content with php
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
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
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
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.