Hello support team,
Converting html to pdf. The html document contains images with links. In the result pdf links on images are gone.
Links on images <a href="…"><img src="…" /></a> are not working.
Links on text <a href="…">Link title</a> are working.
The input (there are html file in zip package):
Input document.zip (313 Bytes)
The result:
Output document.pdf (277.6 KB)
The conversion code:
MemoryStream resultStream = new MemoryStream(); using (MemoryStream htmlStream = new MemoryStream(Encoding.UTF8.GetBytes(html))) { HtmlLoadOptions options = new HtmlLoadOptions(); if (contentWidth != null) { options.PageInfo.Width = contentWidth.Value; } options.IsRenderToSinglePage = true; options.IsEmbedFonts = true; options.PageInfo.Margin = new MarginInfo(0, 0, 0, 0); Document pdfDocument = new Document(htmlStream, options); pdfDocument.Save(resultStream); } return resultStream;
Using the latest Aspose.PDF for .NET (21.4.0.0).
Thank you!
Martin