Page 1 of 1

WebAssembly Embedded Fonts

Posted: Fri Jan 23, 2026 8:00 am
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.

Re: WebAssembly Embedded Fonts

Posted: Mon Jan 26, 2026 7:20 am
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

Re: WebAssembly Embedded Fonts

Posted: Mon Jan 26, 2026 12:16 pm
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.