I have problem with fonts while exporting to HTML (PDF is fine)

Stimulsoft Reports.NET discussion
Post Reply
salut
Posts: 2
Joined: Wed Feb 26, 2025 12:32 pm

I have problem with fonts while exporting to HTML (PDF is fine)

Post by salut »

I have problem with fonts in output files.
I use following code:

Code: Select all

StiReport report = new StiReport();
var loadedTemplate = report.Load(@"C:\folder\template.mrt");
var rdyDoc = loadedTemplate.LoadDocument(@"C:\folder\report.mdc");
rdyDoc.ExportDocument(StiExportFormat.Pdf, @"C:\folder\pdfOutput.pdf");
rdyDoc.ExportDocument(StiExportFormat.Html, @"C:\folder\htmlOutput.html");
htmlOutput doesn't have appropriate font (just some replacement like Arial or something ugly) while PDF works fine.
Any ideas how to fix it?
Lech Kulikowski
Posts: 7333
Joined: Tue Mar 20, 2018 5:34 am

Re: I have problem with fonts while exporting to HTML (PDF is fine)

Post by Lech Kulikowski »

Hello,

Please clarify what product and version are you use?

Thank you.
salut
Posts: 2
Joined: Wed Feb 26, 2025 12:32 pm

Re: I have problem with fonts while exporting to HTML (PDF is fine)

Post by salut »

Stimulsoft.Reports.Web.NetCore 2025.1.4
Stimulsoft.Reports.Engine.NetCore 2025.1.4
.NET / C#
Can older mdc files (from version 2022.1.6 be a problem? (is there any option to convert those to recent version?)
Lech Kulikowski
Posts: 7333
Joined: Tue Mar 20, 2018 5:34 am

Re: I have problem with fonts while exporting to HTML (PDF is fine)

Post by Lech Kulikowski »

Hello,

Try to add font files in the font collection before exporting:
Stimulsoft.Base.StiFontCollection.AddFontFile();

Thank you.
Post Reply