Closed APerricone closed 10 months ago
It is normal.
Which part of "Implement IFontResolver and assign to "GlobalFontSettings.FontResolver" to use fonts." you do not understand?
Try the GDI or WPF builds of PDFsharp to get it working without own FontResolver.
Full sample code here: https://github.com/empira/PDFsharp.Samples/blob/master/src/samples/src/PDFsharp/src/HelloWorld/Program.cs
Do not omit the important lines 12 and 13:
if (Capabilities.Build.IsCoreBuild) GlobalFontSettings.FontResolver = new FailsafeFontResolver();
Which part of "Implement IFontResolver and assign to "GlobalFontSettings.FontResolver" to use fonts." you do not understand? Everything... why is it not included? Try the GDI or WPF builds of PDFsharp to get it working without own FontResolver. I am creating a pdf without graphic interface
Full sample code here: https://github.com/empira/PDFsharp.Samples/blob/master/src/samples/src/PDFsharp/src/HelloWorld/Program.cs
Do not omit the important lines 12 and 13:
if (Capabilities.Build.IsCoreBuild) GlobalFontSettings.FontResolver = new FailsafeFontResolver();
looks I forget those lines.. thanks
Everything... why is it not included? It is included. The PDFsharp Core build can be used under Windows, MacOS, Linux, ... and we include FontResolvers that are suitable for the samples. Your app must include FontResolvers that are suitable for your app. AFAIK there are no TrueType fonts that are always installed under all Linux distributions.
Try the GDI or WPF builds of PDFsharp to get it working without own FontResolver.
I am creating a pdf without graphic interface If your code runs under Windows only, you can still use the PDFsharp builds made for Windows that will automatically use all the fonts installed under Windows. This makes life much easier. If you take the version for Windows, MacOS, and Linux, then include the fonts you need.
Hi, I copied the code of hello world:
and get
Is it normal?