Aspose HTML to PDF rendering issue : .Net Core library

Dear Support Team,

We are using Aspose library extensively to convert HTML data into PDF and most of the time conversion code works perfectly but in some cases, it is not rendering data properly and final output is missing text, data and sometimes adding special chars. The issue is random and we are not sure about the root cause. This issue is coming now frequently in production environment and would really appreciate your help to close this issue.

I am also attaching sample HTML file to reproduce issue and link we used to generate PDF outside of our code ( to reproduce this issue).

HTML to PDF Converter - free online app | Convert HTML from anywhere

Sample Files.zip (129.4 KB)

@rajsingh008

It looks like you are using Aspose.HTML for .NET 22.9. Please try to use the latest available version i.e. 22.12. Also, the issue looks related to the missing font in the environment. Please make sure that the fonts that support non-English characters are present in the environment.

You can use FontsSettings.SetFontsLookupFolder method to set the folder used during fonts selection as shown below.

var config = new Configuration();
config.GetService<IUserAgentService>().FontsSettings.SetFontsLookupFolder("folder");
using var doc = new HTMLDocument("url", config);

Dear Asad,

Thank you very much for your prompt response and solution to resolve Aspose issue.
We tried this implementation and unfortunately it did not work for us. We upgraded Aspose to latest version and added font settings but we were getting same issue.
So, we looked into alternative approaches and were able to resolve it by changing some css values in HTML page :slight_smile: .

@rajsingh008

It is nice to know that you are able to resolve your issue. Please keep using our API and feel free to create a new topic in case you notice any issues.

1 Like