Page 1 of 1

Using a custom fonts in pdf report

Posted: Wed Sep 20, 2023 6:58 am
by dudkoov
Using a custom fonts in pdf report

I have created a report with text in a different custom fonts.
I'm trying to embed fonts in a report using option 'StiOptions.Export.Pdf.AllowImportSystemLibraries = true;' in my Linux system, and the custom fonts are now not displaying in the exported PDF, and i get a following error in my log files:

Message: Could not open display (X-Server required. Check your DISPLAY environment variable)\n\tTrace: at Graphics System.Drawing.Graphics.FromHwnd(IntPtr hwnd)\n at void Stimulsoft.Report.Export.StiPdfExportService.CheckGraphicsForTextRenderer()\n at void Stimulsoft.Report.Export.StiPdfExportService.StoreWysiwygSymbols(StiText text, int pageNumber)\n at void Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)\n at void Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)\n at StiReport Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)\n

So, the main question: Can i use this option in my Linux system? (StiOptions.Export.Pdf.AllowImportSystemLibraries = true;) for export fonts in pdf report or it still only for Windows?

OC Linux version: RED OS MUROM (7.3.2)
Kernel: Linux 5.15.87-1.el7.3.x86_64
Stimul versions:
Stimulsoft.Reports.Engine.NetCore 2023.3.4
Stimulsoft.Svg 2023.3.4
SystemThreading.Timer 4.3.0

Please, I need some help with this.

Re: Using a custom fonts in pdf report

Posted: Thu Sep 21, 2023 6:59 am
by Lech Kulikowski
Hello,

Please try to add fonts in the Font Collection:
Stimulsoft.Base.StiFontCollection.AddFontFile();

Thank you.

Re: Using a custom fonts in pdf report

Posted: Thu Sep 21, 2023 7:39 am
by dudkoov
This means that the option (StiOptions.Export.Pdf.AllowImportSystemLibraries = true;) does not work for Linux in my version?

Re: Using a custom fonts in pdf report

Posted: Thu Sep 21, 2023 9:02 am
by Lech Kulikowski
Hello,

Yes, that option for the windows systems.

Thank you.