Simple test as shown below results in most of the html’s body being duplicated. Oddly, the majority of the body in the resulting PDF is included twice in a row. HTML displays find in browser.
What am I doing wrong?
Blockquote
String tmpHtmlFile = targetFile.getCanonicalPath() + “.html”;
Files.writeString(Paths.get(tmpHtmlFile), html);
// Initialize HTMLLoadSave Options
HtmlLoadOptions options = new HtmlLoadOptions();
//options.setHtmlMediaType(HtmlMediaType.Screen);
//options.setPageLayoutOption();
try (com.aspose.pdf.Document doc = new com.aspose.pdf.Document(tmpHtmlFile, options))
{
doc.setOptimizeSize(true);
doc.save(targetFile.getCanonicalPath());
}