LinuxQuestions.org
Visit Jeremy's Blog.
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 07-11-2008, 01:19 AM   #1
poeta_boy
Member
 
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?

Thanks!
 
Old 07-12-2008, 08:54 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,262

Rep: Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660
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.

Regards
 
Old 01-26-2009, 09:13 AM   #3
ozz
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);
f.convert(fos,"pdf");

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

Library can be obtained from: dancrintea.ro/html-to-pdf/
 
  


Reply

Tags
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 06:38 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration