Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-11-2008, 01:19 AM   #1
Registered: Oct 2003
Location: Mexico
Distribution: Ubuntu
Posts: 223

Rep: Reputation: 31
using Java as web app, transform a word (.doc) document into JGP or HTML

Hello everyone:

I need to create a web application on java that can upload a word file (.doc) and the display it either as a image file, or HTML file. The doc file will have images, formatting, etc.

I've seen java apis such as POI, but it's quite limited regarding formatting.

I was thinking is there's a way to use the functionality of MS Word itself, somehow programmatically do a "save as html"

or maybe just upload it, and have a daemon on the server side that catches every doc file and transform it into image.... I haven't found anything like that tough

any ideas?

Old 07-12-2008, 08:54 AM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2015, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 15,899

Rep: Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021
Having "Abiword" installed the command
'abiword --to=html *.doc' or 'abiword --to=pdf *.doc'
will convert all .doc files in a directory.

(Starting Abiword is not necessary)

Try it, and see if the formatting is usable.

Old 01-26-2009, 09:13 AM   #3
LQ Newbie
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
Lightbulb java solution

A solution:

import officetools.OfficeFile;
FileInputStream fis = new FileInputStream(new File("test.html"));
FileOutputStream fos = new FileOutputStream(new File("test.pdf"));
OfficeFile f = new OfficeFile(fis,"localhost","8100", true);

All possible convertions:
html --> pdf
doc --> pdf, html, txt, rtf
xls --> pdf, html, csv
ppt --> pdf, swf

Library can be obtained from:


html, java, word

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need a Document.all solution which transform any ma js script. nadavvin Linux - Software 1 11-10-2006 12:55 PM
(java) BASIC and FORM based auth in the same web app mhiggins Programming 0 10-14-2004 11:07 AM
How can I transform XML into HTML on bash? pedrosan Linux - Newbie 0 04-22-2004 03:37 AM
.html to MS Word doc h/w Linux - Software 5 12-06-2003 04:28 PM
Konqueror + file:/usr/share/doc/HTML/index.html jon_k Linux - Software 2 11-25-2003 06:06 AM

All times are GMT -5. The time now is 05:28 AM.

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