Using a custom fonts in pdf report

Stimulsoft Reports.NET discussion
Post Reply
dudkoov
Posts: 2
Joined: Tue Sep 19, 2023 6:35 pm

Using a custom fonts in pdf report

Post 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.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using a custom fonts in pdf report

Post by Lech Kulikowski »

Hello,

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

Thank you.
dudkoov
Posts: 2
Joined: Tue Sep 19, 2023 6:35 pm

Re: Using a custom fonts in pdf report

Post by dudkoov »

This means that the option (StiOptions.Export.Pdf.AllowImportSystemLibraries = true;) does not work for Linux in my version?
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using a custom fonts in pdf report

Post by Lech Kulikowski »

Hello,

Yes, that option for the windows systems.

Thank you.
Post Reply