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.
WebAssembly Embedded Fonts
-
Vincent Yeoh
- Posts: 2
- Joined: Fri Nov 07, 2025 2:31 am
-
Max Shamanov
- Posts: 1097
- Joined: Tue Sep 07, 2021 10:11 am
Re: WebAssembly Embedded Fonts
Hello, Vincent.
Could you please clarify whether you add a font file to the StiFontCollection?
Also, please clarify what version you are using?
We need time to prepare an answer for you.
Thank you.
#19340
Could you please clarify whether you add a font file to the StiFontCollection?
Also, please clarify what version you are using?
Because Blazor Wasm does not have a server, some events work differently.**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?
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
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.
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.