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

Free Support Forum - aspose.com

"Embedded font 'xxx' not found" in HTML to PDF conversion

Hello - we am using Aspose.Pdf for .Net verson 9.1 on behalf of a client. We have implemented a process which renders incoming email messages from the public into a PDF. We assume that the email is in HTML format, so essentially we are converting HTML to PDF. In most cases, this works fine, but occasionally a sender will be using an unusual font (eg. "Roman", "Sans-Arial") which causes the PDF Save() method to throw the above error.

Ideally, we would like the software to simply handle the unknown font, by converting it to something standard like Arial. I realize that this may not be a desirable feature in general, but for us, the requirement is simply to be able to generate a PDF document that a person can review without having to open the actual .eml file. We cannot (realistically) install every font on the web server that an external person might try to use, so we need to be able to react AFTER the email is received.

I've created a workaround which traps this error, and modifies the HTML body to change the unknown font to Arial, and then tries again. This works, but I'm wondering if you have a generic solution for this.

I found a post in this form (550974) which mentions that this error was resolved in Aspose.Pdf for .Net 9.3.0.0. I downloaded the DLL and installed it, but I am still receiving the same error for unknown fonts.

Cheers

David Webb

Habanero Consulting Group

Hi David,


Thanks for contacting support and sorry for the delayed response.

In recent release versions, we have fixed many issues related to HTML to PDF conversion. However from file to file, the scenario varies due to different structure and complexity of documents. Can you please share some sample HTML files (emails in html format), so that we can test the scenario at our end.

Furthermore, you may also consider using Aspose.Words which also supports the feature to read HTML and save the output in PDF format. It also supports the feature to specify default font while rendering the output.

For more information, please visit