Free Support Forum - aspose.com

Convert complex HTML that contains SVG diagrams to PDF (in result pdf text in Svg images must be selectable and searchable)

We want to convert in Java complex HTML (that contain SVG diagrams) to PDF (in result pdf text in Svg images must be selectable and searchable).

fileExample.zip (792.6 KB)

@giedrius14

Thanks for showing interest in our API.

The HTML file that you shared contains SVG image reference URL in it which renders as a complete image. If you convert this file using both Aspose.PDF or Aspose.HTML, it would render as an image inside generated PDF. On the other hand, Aspose.PDF provides the feature to convert SVG image into PDF where SVG data would be drawn as graphics inside PDF and text objects will be searchable as well.

SvgLoadOptions svgoptions = new SvgLoadOptions();
Document doc = new Document(dataDir + "Diagram.html", svgoptions);
doc.save(dataDir + "HTMLtoPDF_20.1.pdf");

From your post, it seems you are interested in Aspose.HTML for Java. The required feature request has been logged as HTMLJAVA-364 in our issue tracking system for the sake of implementation. We will surely inform you as soon as the feature is available. Please spare us some time.

We are sorry for the inconvenience.