Here’s the sample code using Aspose.Words for Java to convert html to pdf.
Document doc = new Document("xx.html");
doc.save("xxxx.pdf");
After convertion, the .pdf file did not keep all the style of the .html file. Examples as shown below.
1 The background color of a div becomes uncontinous.
the div background in .html file:
in .pdf file
2 Table format
in .html file
in .pdf file
Am I missing any configurations?