Free Support Forum - aspose.com

SVG images within HTML are missing letters after conversion to PDF

Hi,

When we convert an html with svg images to pdf (using aspose.pdf to java), many images miss some of the letters.

Sample Java code:

HTMLDocument htmlDocument = new HTMLDocument(RESOURCE_DIR + "template_with_svg.html");
HtmlRenderer htmlRenderer = new HtmlRenderer();

try(OutputStream outputStream = new FileOutputStream("result_pdf_from_html_with_svg.pdf"))
{
 htmlRenderer.render(new PdfDevice(new PdfRenderingOptions(), outputStream), htmlDocument);
}

Sample html:

<html lang="en">
<head>
<title>SVG export test</title>
<meta charset="utf-8"/>
</head>

<body>

<div>
<p>Some text</p>
</div>

<p>Title</p>

<img src="image1.svg" alt="" />

</body>
</html>

image1.svg with output in output1.pdf and problem places are provided in the following file, case1 dir:

cases.zip (500.3 KB)

@arjana3,

Thanks for sharing further details.

I have worked with source file and sample code shared by you and have been able to observe the issue. I have logged ticket as HTMLJAVA-393 in our issue tracking system. We will further look into details of it and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.