I think it can also help others. Code is very clean:
import officetools.OfficeFile; 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", false); f.convert(fos,"pdf");
You can obtain officetools.jar from this guy's website: dancrintea.ro/doc-to-pdf/
If you are using other solutions, it would be nice to share.