DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page convert doc/xls/html to pdf
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2009
Lightbulb convert doc/xls/html to pdf - 02-02-2009, 10:02 AM

I came across a nice and new solution that allows using Java to convert:

html --> pdf
doc --> pdf, html, txt, rtf
xls --> pdf, html, csv
ppt --> pdf, swf

Example code for ms doc to pdf:

Code:
import officetools.OfficeFile; // available at www.dancrintea.ro/doc-to-pdf/ 
...
FileInputStream fis = new FileInputStream(new File("test.doc")); // works with xls also
FileOutputStream fos = new FileOutputStream(new File("test.pdf"));
OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
f.convert(fos,"pdf");
I hope it will help others too.
Reply With Quote
  (#2 (permalink)) Old
Moderator
 
jwenting's Avatar
 
Posts: 99
Thanks: 0
Thanked 8 Times in 8 Posts
Join Date: Feb 2008
Send a message via MSN to jwenting
Default 02-02-2009, 10:51 AM

There is always XSL:FO (as used in for example FOP) if you want to go really down to the wire.
Would work best with text-based input though (like the new Office 2007 docx and xslx formats).
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Eclipse project to HTML sarv6 Eclipse 0 12-02-2008 12:39 AM
Editing .dox files with HTML code in Eclipse? dangerdg Eclipse 0 05-22-2008 11:48 AM
how to search xml file data based on the given keyword from html form nicemothi Java 0 04-04-2008 03:51 AM
How to supress html validation errors in "target" folder thebugslayer Eclipse 0 02-27-2008 09:06 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com