WebAssembly Embedded Fonts

Stimulsoft Reports.BLAZOR discussion
Post Reply
Vincent Yeoh
Posts: 2
Joined: Fri Nov 07, 2025 2:31 am

WebAssembly Embedded Fonts

Post by Vincent Yeoh »

Hi all,

I’m working on a Blazor WebAssembly project using Stimulsoft Reports.
Chinese characters display correctly in the viewer and when using the Print → Save as PDF option.
However, when I use the viewer’s Save → Adobe PDF button, the exported file shows invisible characters where the Chinese text should be.
Copying those characters into another editor reveals the text, so it seems to be a font embedding issue.

I found in the forum that enabling font embedding helps, so I tried to handle the export event:


<StiBlazorViewer OnExportReport="OnExportReportToSave" />

@code {
private void OnExportReportToSave(StiExportReportEventArgs args)
{
if (args.Format == StiExportFormat.Pdf)
{
var settings = new StiPdfExportSettings { EmbeddedFonts = true };
using var ms = new MemoryStream();
Report.ExportDocument(StiExportFormat.Pdf, ms, settings);
}
else
{
using var ms = new MemoryStream();
Report.ExportDocument(args.Format, ms);
}
}
}
But in Blazor WebAssembly, the `OnExportReport` event never fires when I click Save → Adobe PDF.
Other formats (Word, Excel, etc.) keep the Chinese characters fine.

**Question:** How can I intercept the Save → Adobe PDF export in Blazor WebAssembly so I can apply `EmbeddedFonts = true`?
Is there a different event or server‑side hook I should be using?

PS: For Blazor Server, the events I would trigger would work, just WebAsembbly would have this issue.
Max Shamanov
Posts: 1097
Joined: Tue Sep 07, 2021 10:11 am

Re: WebAssembly Embedded Fonts

Post by Max Shamanov »

Hello, Vincent.

Could you please clarify whether you add a font file to the StiFontCollection?
Also, please clarify what version you are using?
**Question:** How can I intercept the Save → Adobe PDF export in Blazor WebAssembly so I can apply `EmbeddedFonts = true`?
Is there a different event or server‑side hook I should be using?
Because Blazor Wasm does not have a server, some events work differently.
We need time to prepare an answer for you.

Thank you.
#19340
Max Shamanov
Posts: 1097
Joined: Tue Sep 07, 2021 10:11 am

Re: WebAssembly Embedded Fonts

Post by Max Shamanov »

Hello, Vincent.

Could you send us an example project that shows how this works with Blazor Server?
Also, could you send us the PDF files that you get from both the Wasm and Server versions?

Thank you.
Post Reply