Font does not get loaded

Hi,

We had a running application which used a google font “Roboto”, everything worked fine until a week ago.

Every font defaults and we cannot find the issue.

We have tried a simple example, yet the issue remains.

Here is a link to the sample html we tested https://pastebin.com/JcezvZAP.

Besides this example we also tried including the font file as a base64 encoded string, but the problem remained.

Thank you in advance!

Hi Tom,


Thank you for contacting support. The target HTML page shows an error as “this page has been removed”. Kindly share complete details of the use case, including source files (if any), code and Aspose.Pdf for .NET API version which you are using. We will then investigate and share our findings with you. Your response is awaited.

My apologies.

A sample of the HTML we use: https://pastebin.com/ubXbkYeH

A sample of the C# code we use to generate the PDF: https://pastebin.com/jqYd6dtf

We’re using version 3.0.

Thanks in advance for your reply.

Kind regards

Hi Tom,


Thank you for sending an HTML document and code. Your source code is not in fully compilable form because the single method of code is taking two HTML parameters and we do not know the actual HTML parameters. The code of CreateDocument and GetFooter methods is not available. Kindly prepare a complete code example and share in this thread which we could run in our environment to further investigate the scenario. Your response is awaited.

Furthermore, we have converted your source HTML string to PDF using the latest version 17.5 of Aspose.Pdf for .NET API and the final PDF looks fine. We have attached the output PDF document to this reply. Please refer to this help topic: Convert a File to PDF Format

Hi

Here is a more complete example:

  • C# code: https://pastebin.com/MQQXjw99
  • ’htmlContents’ parameter for the CreatePdfFromHtmlAsync function has 1 item: https://pastebin.com/9WDADnKc
  • ’htmlFooterContent’ parameter is this: https://pastebin.com/7Sm6krYY

The output file that you sent has the same problem as we’ve been encountering. The ‘Roboto’ font is not used, and a default ‘Times New Roman’ or something is used instead.

I’ve attached 2 images. One is a screenshot of the PDF you sent, the other is an example of the Roboto font.

Kind regards

Tom

My apologies.

A sample of the HTML we use: https://pastebin.com/ubXbkYeH

A sample of the C# code we use to generate the PDF: https://pastebin.com/jqYd6dtf

We’re using version 3.0.

Thanks in advance for your reply.

Kind regards