wood burning stoves 2.0*
The moose likes Servlets and the fly likes Viewing MS Word Docs using a Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Viewing MS Word Docs using a Servlet" Watch "Viewing MS Word Docs using a Servlet" New topic
Author

Viewing MS Word Docs using a Servlet

Majid Al-Fifi
Ranch Hand

Joined: Aug 22, 2006
Posts: 45
Hi all,

If your web application needs to view MS Word documents to users in HTML, what is the best practice to do that?

Is there any library that I can use to convert MS Word docs to HTML with similar format as the original Word doc.

Thanks,
Majid
[ May 15, 2007: Message edited by: Majid Al-Fifi ]

SCJP1.4, SCWCD1.4
Srikkanth Mohanasundaram
Ranch Hand

Joined: Feb 07, 2007
Posts: 185
Hi,
Do you want to show MS WORD doc to your user?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41060
    
  43
There is no general-purpose Word-to-HTML converter. You can try OpenOffice, which has a Java API, and can read Word files and save to HTML.

It's possible to extract the text from a Word document using the Jakarta POI library.


Ping & DNS - my free Android networking tools app
rohan sans
Greenhorn

Joined: Jul 24, 2003
Posts: 10
Any Idea about doc to pdf converter API or Open source software , which is platform independant? other than OpenOffice.
Majid Al-Fifi
Ranch Hand

Joined: Aug 22, 2006
Posts: 45
Ulf Dittmer,

Do you see jakarta POI library a well established because it's not clear what is the status of the project now.

Is it worth trying in my project in which users will submit MS docs to me and I need to provide them with an interface to view those documents in the explorer as HTML. I don't want to use "Save As HTML" feature of MS Word.

Thanks!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41060
    
  43
Do you see jakarta POI library a well established because it's not clear what is the status of the project now.

It's true that the DOC part of POI is less developed than the XLS part, but there has been some progress in the 3.0 alpha build. If it does what you need done, great, if it doesn't then chances are the missing feature won't be coming soon.

Is it worth trying in my project in which users will submit MS docs to me and I need to provide them with an interface to view those documents in the explorer as HTML.

As mentioned before, POI can extract text from DOC files. If that's sufficient for your purposes I don't see why you wouldn't give it a try.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Viewing MS Word Docs using a Servlet
 
Similar Threads
WA #1.....word association
Acrobat reader question
Design document
PDF Converter
empty lines in a document.