Page 1 of 1

Custom fonts not applied to exported PDF report

Posted: Tue Oct 23, 2018 9:40 am
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

Re: Custom fonts not applied to exported PDF report

Posted: Wed Oct 24, 2018 10:25 am
by Lech Kulikowski
Hello,

Please check the last release version.

Thank you.

Re: Custom fonts not applied to exported PDF report

Posted: Wed Oct 24, 2018 10:51 am
by smckec
Hi,

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

Thanks

Re: Custom fonts not applied to exported PDF report

Posted: Fri Oct 26, 2018 2:19 pm
by Lech Kulikowski
Hello,

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

Thank you.

Re: Custom fonts not applied to exported PDF report

Posted: Mon Oct 29, 2018 4:44 pm
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!

Re: Custom fonts not applied to exported PDF report

Posted: Tue Oct 30, 2018 7:28 pm
by Lech Kulikowski
Hello

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

Thank you.