Page 2 of 4

Re: Report Viewer in shadow DOM

Posted: Fri Mar 06, 2026 2:17 am
by noob
Thanks

Re: Report Viewer in shadow DOM

Posted: Fri Mar 06, 2026 10:54 am
by Max Shamanov
Hello,

We have made several fixes, and fonts should now display correctly in Print-Print mode.
Please load the fonts you use into StiFontCollection.
You will also need to enable the following option:

Code: Select all

AllowLoadingCustomFontsToClientSide = true
.
You should specify it in the Designer options as follows:

Code: Select all

public StiBlazorDesignerOptions Options = new StiBlazorDesignerOptions()
{
       Server =
    {
        AllowLoadingCustomFontsToClientSide = true
    }
};
Please check our next build once it becomes available.


Thank you.

Re: Report Viewer in shadow DOM

Posted: Fri Mar 06, 2026 1:38 pm
by noob
Thanks

Re: Report Viewer in shadow DOM

Posted: Mon Mar 09, 2026 7:59 am
by noob
Hello Max,

i have checked my Designer options and i already have below configurations:

Code: Select all

 await Assembly.GetExecutingAssembly().InitializeStimulsoftLicenceAsync();
 
Options = new StiBlazorDesignerOptions();
Options.Server.AllowLoadingCustomFontsToClientSide = true;
Options.Appearance.DefaultUnit = StiReportUnitType.Millimeters;
Options.Behavior.UndoMaxLevel = 3;

 // Kjino font
 using var kjinoStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.Kjino.ttf");
 using var kjinoMemoryStream = new MemoryStream();
 await kjinoStream.CopyToAsync(kjinoMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("Kjino", Convert.ToBase64String(kjinoMemoryStream.ToArray()));

 // Noto Naskh Arabic font
 using var notoNaskhArabicStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.NotoNaskhArabic.ttf");
 using var notoNaskhArabicMemoryStream = new MemoryStream();
 await notoNaskhArabicStream.CopyToAsync(notoNaskhArabicMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("Noto Naskh Arabic", Convert.ToBase64String(notoNaskhArabicMemoryStream.ToArray()));

 // Parwarda font
 using var parwardaStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.Parwarda.ttf");
 using var parwardaMemoryStream = new MemoryStream();
 await parwardaStream.CopyToAsync(parwardaMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("Parwarda", Convert.ToBase64String(parwardaMemoryStream.ToArray()));

 // KRD font
 using var krdStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.KRD.ttf");
 using var krdMemoryStream = new MemoryStream();
 await krdStream.CopyToAsync(krdMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("KRD", Convert.ToBase64String(krdMemoryStream.ToArray()));

 // KRD Bold font
 using var krdBoldStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.KRD-Bold.ttf");
 using var krdBoldMemoryStream = new MemoryStream();
 await krdBoldStream.CopyToAsync(krdBoldMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("KRD Bold", Convert.ToBase64String(krdBoldMemoryStream.ToArray()));
 
 Report = await Repository.LoadReportAsync(Id);
 StateHasChanged();

so, do i have to wait for the next update to those configs take effect? and does those settings affect the ReportViewer too, to fix the font issue?

Re: Report Viewer in shadow DOM

Posted: Mon Mar 09, 2026 9:50 am
by Max Shamanov
Hello,

Yes, you should wait for the next major release.
If you are using ReportViewer separately from the designer, you should specify these options too for the viewer.

Thank you.

Re: Report Viewer in shadow DOM

Posted: Mon Mar 09, 2026 4:23 pm
by noob
Hello,

Yes, the ReportViewer is separate, but the option ( AllowLoadingCustomFontsToClientSide ) is not available for ReportVIewer.

Re: Report Viewer in shadow DOM

Posted: Tue Mar 10, 2026 6:04 am
by Max Shamanov
Hello,

For the viewer, you should use the following code:

Code: Select all

public StiBlazorViewerOptions Options = new StiBlazorViewerOptions()
{
    Server =
{
    AllowLoadingCustomFontsToClientSide = true
}
};
Thank you.

Re: Report Viewer in shadow DOM

Posted: Thu Mar 12, 2026 8:29 am
by noob
Hello Max,

I have updated to the latest version 2026.1.5, but I am still experiencing issues with custom referenced fonts in Print-Print. This problem is preventing my production application from being used, as printing is not possible due to no font being applied. Please review the attached screenshot and report file.

Also I have applied all the mentioned options for the Viewer and the Designer like loading the fonts to StiFontCollection and AllowLoadingCustomFontsToClientSide.

Thank you.
test.mrt
(256.82 KiB) Downloaded 82 times
Screenshot 2026-03-12 112108.jpg
Screenshot 2026-03-12 112108.jpg (436.23 KiB) Viewed 17047 times

Re: Report Viewer in shadow DOM

Posted: Thu Mar 12, 2026 1:52 pm
by Max Shamanov
Hello,

As mentioned earlier, this fix will be included in the next major version 2026.2.1.
Please check it when it becomes available.

Thank you.

Re: Report Viewer in shadow DOM

Posted: Fri Mar 13, 2026 1:26 pm
by noob
Good, when that version will be available?

Thanks