View Single Post
  (#1 (permalink)) Old
zeet zeet is offline
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