Getting an error when I try to run Syncfusion PDF sample from Github

Hi,

I have just download the File format demo code for ASP.Net Core from Syncfusion's official Github repository here. I am interested in the Zugferd invoice controller. When I build the code and simply run the demo app. I get an error on the following line.

  • Syncfusion.Pdf.Graphics.PdfStandardFont.InitializeInternals(bool isLicense)

  • samplebrowser.Controllers.PdfController.CreateZugFerdInvoicePDF(PdfDocument document) in ZugferdController.cs

    1. PdfStandardFont headerFont = new PdfStandardFont(PdfFontFamily.Helvetica, 30);

The error that I get is PdfConformanceException: All the fonts must be embedded in Pdf_A3B document.

I am an absolute newbie to Syncfusion products so I am totally lost as to what I should do? Can you guys please advise me on what I might be doing wrong?

Thanks in advance!



3 Replies 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team July 15, 2020 10:00 AM UTC

Hi Syed,    
   
Thank you for contacting Syncfusion support.    
   
We have analyzed the reported issue. While creating the PDF/A-3B (ZUGFeRD invoice), the font should be embedded and we need to use the PdfTrueTypeFont. So instead of PdfStandardFont, kindly use the PdfTrueTypeFont while creating the ZUGFeRD invoice.    
   
Code Snippet:    
FileStream fontStream = new FileStream(dataPath + "arial.ttf", FileMode.Open,FileAccess.Read, FileShare.ReadWrite);   
PdfTrueTypeFont headerFont = new PdfTrueTypeFont(fontStream, 30,PdfFontStyle.Regular);   
  
   
Please let us know if you have any concerns about this.    
 
Regards, 
Sowmiya Loganathan 



AF Ahmed Fwela May 17, 2025 06:12 AM UTC

Can you please support embedding standard fonts? or at least expose PdfDocument.DefaultFont to be public instead of internal, so that we would get some control over the default fonts ?


Marked as answer

IJ Irfana Jaffer Sadhik Syncfusion Team May 19, 2025 10:56 AM UTC

Hi Syed,

Regarding your query on embedding standard fonts:

At present, we do not support the direct embedding of standard fonts. This is because standard fonts are internally mapped using predefined glyph data, and embedding would require the actual font file. As an alternative, you can use our PdfTrueTypeFont API to embed custom fonts as needed.

 

About your request to expose Default font:

We’ve logged this as a feature request titled Support to set default font to the PDF document in ASP.NET Core. While we currently don’t have immediate plans to implement this functionality, it is under consideration for one of our future releases. As part of our regular release planning—which occurs approximately every three months—we will review all open feature requests. You will be notified once this feature is scheduled for implementation.

 

You can track the status of this request through the following link:

Support to set default font to the PDF document in ASP.NET Core | Feedback Portal 


Regards,

Irfana J



Loader.
Up arrow icon