LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-26-2008, 12:26 PM   #1
nehaandrew
Member
 
Registered: Nov 2008
Posts: 53

Rep: Reputation: 15
Question Word To HTML


Any ideas how we can convert an MS Word Doc to HTML in PHP?

I tried using a COM object to do this - but some reason it gives me an "No Authorization" error on the Windows 2003 server.

I tried using an external software to do this - still same approach.


As a last resort - I am trying to use Open Office to do this conversion. I read about an approach where you can write a VBA plugin that will use the standard methods (writer_something) in Open Office to achieve this. Has anyone tried this approach?

Does anyone have any better suggestions on how one can achieve a conversion from DOC to HTML from within a PHP code?
(I've been breaking my arse on this for the last 2 weeks now!)


Thanks a zillion in advance!!!
 
Old 11-26-2008, 12:57 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Really not an expert on this, but just a suggestion...

Would it be possible to get PHP to call a VBScript to do the export, then pick up the resulting HTML file?

I've used VBScript to export excel spreadsheets to HTML, but only within Office itself, so I don't know if it's possible from an external system call.

Dave
 
Old 11-26-2008, 01:51 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
I once used this ( #2 )
http://www.linuxquestions.org/questi...hlight=abiword
 
Old 11-26-2008, 04:42 PM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
I would think the easiest way would be to invoke a vb script from PHP as has been suggested.

Note, though, that Word writes simply horrible HTML code.
 
Old 11-27-2008, 04:38 AM   #5
nehaandrew
Member
 
Registered: Nov 2008
Posts: 53

Original Poster
Rep: Reputation: 15
@ilikejam,
If you dont mind - can you please share the VBScript code that you used to convert excel into HTML. Maybe I'll be able tweak it to convert Word to HTML.
I plan to invoke the VBScript (embedded into MS word or Open Office) from PHP to do the trick.

(Whether it works or not is another story though!)



Thanks a lot for the suggestions folks. You guys are swell ...


Linux

Last edited by nehaandrew; 11-30-2008 at 01:21 AM.
 
Old 11-27-2008, 05:39 AM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Look for "demoroniser" when dealing with MS tools generated HTML.
 
Old 11-27-2008, 08:59 AM   #7
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi again. No can do, I'm afraid - I'm off work at the moment, and my VPN password's expired. I did find this though:
http://www.xefteri.com/articles/show.cfm?id=22
Probably better than my efforts.

Dave
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using Java as web app, transform a word (.doc) document into JGP or HTML poeta_boy Programming 2 01-26-2009 08:13 AM
Problems Copying & Pasting In Word When Word Closes - Ubuntu davidx Linux - Software 3 10-22-2008 08:21 PM
LXer: Benchmarking Microsoft Word 95 through Word 2007 LXer Syndicated Linux News 0 07-24-2008 01:00 AM
LXer: Composer, a potential HTML based word processor LXer Syndicated Linux News 0 06-04-2008 10:20 PM
.html to MS Word doc h/w Linux - Software 5 12-06-2003 03:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration