I am converting HTML string to PDF, (latest version of aspose.pdf) In my HTML string there is a font tag like below,
(see attachment for the file/string i’m converting)
That is causing the following exception message, The embedded font ‘univers’ is not found. Make sure that you set correct path to the font file.
Whereas on my local machine univers font is installed. ( i debug my project with VS local)
So 2 questions:
Is it possible to set a kind of property which overrules this font with a standard sytem font when not found??
Or how i can set the correct path?? I already set an .imgUrl property for my images but can’t find something for fonts
*update: found this property through your documentation : .IsFontNotFoundExceptionThrown
This one is set to default “False” but doesn’t work.I’m getting the error
I have tested the scenario where I have used the following code snippet and as per my observations, NullReferenceException is being generated during conversion process. For the sake of correction, I have logged this issue as PDFNEWNET-36139 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.
C#
// load HTML contents
Aspose.Pdf.Document source = new Aspose.Pdf.Document(@"C:\pdftest\TestCase.html", new HtmlLoadOptions());
// save output as PDF format
source.Save(@"C:\pdftest\TestCase.pdf");
PS, can you please share the code snippet which can help us in replicating the issue which you are getting.
One file is the html string, the other one the simple code i use to generate the PDF
Error on pdf.save(): The embedded font ‘univers’ is not found. Make sure that you set correct path to the font file.
Hi Michel,
Thanks for sharing the resource files.
I have again tested the scenario and have observed that when trying to save the output in Stream object "The embedded font ‘univers’ is not found. Make sure that you set correct path to the font file."exception is being generated. For the sake of correction, I have associated this information with earlier logged issue PDFNEWNET-36139. The development team will definitely consider this scenario during the resolution of this problem. Please be patient and spare us little time. We apologize for this inconvenience.
The generated document is the same as the HTML file and gives NO error on my fonts!
So there is a great difference between HTML conversion in aspose.PDF and aspose.WORD!!
Hi Michel,
Aspose.Words for .NET and Aspose.Pdf for .NET have separate document rendering engine and we have observed that for some cases, the output generated with Aspose.Words is bit better as compared to the output generated with Aspose.Pdf for .NET. For the time being, you may continue using Aspose.Words for HTML to PDF conversion.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.