Another 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
from dancrintea.ro/html-to-pdf/