there is also another solution that I have seen on a project:
Code:
import officetools.OfficeFile;
...
FileInputStream fis = new FileInputStream(new File("test.doc"));
FileOutputStream fos = new FileOutputStream(new File("test.pdf"));
OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
f.convert(fos,"pdf");
All possible conversions:
doc --> pdf, html, txt, rtf
xls --> pdf, html, csv
ppt --> pdf, swf
html --> pdf
More details about the library on this guy's website: dancrintea.ro/html-to-pdf/