Hi i am trying to use your product to convert from html to pdf,
but always giving me errors like:
com.aspose.html.internal.ms.System.NotSupportedException: getContentAreaBPD() called when it should have been overridden
Exception in thread “main” java.lang.ClassCastException: com.aspose.pdf.internal.html.dom.svg.SVGElement incompatible with com.aspose.pdf.internal.html.dom.svg.SVGGElement
and used below sample code :
String dir = “/rootPath”;
HtmlLoadOptions htmloptions = new HtmlLoadOptions();
Document doc = new Document(dir + “test.html”, htmloptions);
doc.save(dir + “aspose.pdf”);
and
HTMLDocument htmdoc = new HTMLDocument(dir + “tempHTML.html”);
// render to PDF & XPS
HtmlRenderer renderer = new HtmlRenderer();
renderer.render(new PdfDevice(new PdfRenderingOptions(), dir + “output.pdf”), htmdoc);
can u help me, which jar version to use and working sample code, and if i have css files and images needed how to link them
It seems like you are trying both Aspose.PDF and Aspose.HTML. Would you kindly share your sample HTML file in .zip format with us so that we can test the scenario in our environment and address it accordingly?
Also, please check the following useful links in order to convert HTML to PDF: