Custom fonts not applied to exported PDF report

Stimulsoft Reports.NET discussion
Post Reply
smckec
Posts: 12
Joined: Mon Oct 22, 2018 3:04 pm

Custom fonts not applied to exported PDF report

Post by smckec »

Hi,

I’m trying to embed fonts in a report but I cannot see the fonts in the exported PDF.

I have followed this YouTube tutorial video (https://www.youtube.com/watch?v=JtqJ9ZzY7_I) to add custom fonts to the report under Resources, which appear here in the Designer:

Image

I can apply these fonts to text content in the report, which appears fine in the Designer window and in the Preview pane:

Image

However, when exporting a PDF version of the report using the .NET Core Stimulsoft.Reports framework (version 2018.2.3) the custom fonts are not displayed:

Image

This is the section of my API controller that exports the PDF:

Code: Select all

StiReport report = new StiReport();
report.Load(StiNetCoreHelper.MapPath(this, "Reports/DummyReport.mrt"));
StiPdfExportSettings pdfSettings = new StiPdfExportSettings();
pdfSettings.EmbeddedFonts = true;
...
return StiNetCoreReportResponse.ResponseAsPdf(report, pdfSettings, true);
I want to be able to embed the fonts in the PDF so that the client device does not have to have these fonts installed for the report to display consistently and correctly.
I’ve attached the .mrt file and the full controller class that exports the PDF.

Thanks,

Sam
Attachments
ReportController.cs
(1.1 KiB) Downloaded 280 times
DummyReport.mrt
(582.63 KiB) Downloaded 268 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Custom fonts not applied to exported PDF report

Post by Lech Kulikowski »

Hello,

Please check the last release version.

Thank you.
smckec
Posts: 12
Joined: Mon Oct 22, 2018 3:04 pm

Re: Custom fonts not applied to exported PDF report

Post by smckec »

Hi,

I have just tried with Stimulsoft.Reports.Web.NetCore version 2018.3.2 and I still have the issue.

Thanks
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Custom fonts not applied to exported PDF report

Post by Lech Kulikowski »

Hello,

Please try to use the following option:
StiOptions.Export.Pdf.AllowImportSystemLibraries = true;

Thank you.
smckec
Posts: 12
Joined: Mon Oct 22, 2018 3:04 pm

Re: Custom fonts not applied to exported PDF report

Post by smckec »

Lech Kulikowski wrote: Fri Oct 26, 2018 2:19 pm Please try to use the following option:
StiOptions.Export.Pdf.AllowImportSystemLibraries = true;
Thank you - this seems to have fixed the problem!
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Custom fonts not applied to exported PDF report

Post by Lech Kulikowski »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply