Free Support Forum -

Converting html to pdf, links on images are not working (Aspose.PDF for .NET)

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 (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);               
return resultStream;

Using the latest Aspose.PDF for .NET (

Thank you!


I have been able to reproduce the issue on our end. A ticket with ID PDFNET-50067 has been created in our issue tracking system to further investigate the issue on our end. This thread has been linked with the issue so that you may be notified once the issue will be fixed.