We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

HTML to PDF Image Issue

Hello,

My team has recently bumped into an issue when adding adding an img tag src:

    //print logo image
    if (!string.IsNullOrEmpty(logoimage) && string.IsNullOrEmpty(companyname))
    {
        var ext = logoimage.Substring(logoimage.LastIndexOf('.')).ToLower();
        PdfFormat.Append("<div class='icon'><img src='" + logoimage + "' alt='companylogo' /></div>"); 
    }

The image is stored in our Kentico Media Library.
When we output the logoimage variable, the url is correct but html doesn’t output the image correctly. Can you provide any guidance into how diagnose the error? The same code worked properly 1 month ago.

@HPolavaram

Thanks for contacting support.

Would you kindly share a bit more details about the issue like which API you are using and what code snippet are you using to convert HTML into PDF. Also, please share the image URL or HTML file in ZIP format with us. We will test the scenario in our environment and address it accordingly.

Upon further inspection, I believe it could have to do with my media library permissions. Will Aspose need write access to my media library to convert HTML to PDF?

Thank you.

@HPolavaram

Yes, Aspose.PDF needs to be granted with Full Trusted Access as it uses it to load fonts and other required resources at the time of PDF generation.