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