benmajor Posted December 13, 2006 Share Posted December 13, 2006 Hi all,I wonder if anyone can help. I am currently building a website that requires information currently stored in a Word Document to be shown on a basic web page. Obviously one solution is to enter each piece of information in the Word Document into a MySQL database, and then using PHP to retrieve and format the data. However this is obviously a very monotonous task (especially for a 30 page .doc file). As a result I wondered whether it was possible to have PHP convert the document into a formatted HTML page. So for example if the Word file is formatted with a Header, PHP can convert this to <h1> and so on.Is this, or anything similar to this a possibility in PHP?Thanks in adavnce,Ben Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted December 13, 2006 Share Posted December 13, 2006 This might be possible with COM...http://www.php.net/COMHowever, the easiest, and fastest way, would be to use something like Dreamweaver, where you can just copy and paste and it does all the work for you.Or save the word document as a .html file, then use a utility, such as DW, to clean up all the extra "MS Word" tags that it puts in there to get it back to a semi normal html document. Quote Link to comment Share on other sites More sharing options...
fert Posted December 13, 2006 Share Posted December 13, 2006 this isn't possible in php due to how word documents are formatted. Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 13, 2006 Share Posted December 13, 2006 [quote author=fert link=topic=118529.msg484397#msg484397 date=1166051533]this isn't possible in php due to how word documents are formatted.[/quote]According to the code in this post it's possible: http://www.webdeveloper.com/forum/printthread.php?t=23293Here is a proper download page for the script: http://www.getfreesofts.com/script/456/23079/Convert_MSWord_to_html_on_the_fly.html Quote Link to comment Share on other sites More sharing options...
benmajor Posted December 13, 2006 Author Share Posted December 13, 2006 Thanks for the help guys, I will investingate both the COM function, and the last message a little further. Quote Link to comment Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 [quote]this isn't possible in php due to how word documents are formatted.[/quote]Of course its possible, just not easy. The first thing I would do would be to go over to www.phpclasses.org and see if you can't find a class to help you parse the horible mess that is [i]word[/i]. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.