Issue Exporting to pdf, fonts not embedded with encoding identity-h and not with type TrueType(CID)

Stimulsoft Reports.WEB discussion
Post Reply
matijasch
Posts: 2
Joined: Tue May 24, 2022 10:17 pm

Issue Exporting to pdf, fonts not embedded with encoding identity-h and not with type TrueType(CID)

Post by matijasch »

I have some issue exporting the report to pdf, fonts are embeded but not correctly or i dont't know how to do it correctly.
My system is windows 10, .net 6, and in a controller I export it to file and save it to disk.

Code: Select all

var path = "C:/Users/Matija/Desktop/Report69.mrt";
var bytes = System.IO.File.ReadAllBytes(path);
var report = StiReport.CreateNewReport();
report.Load(bytes);
var pdfSettings = new StiPdfExportSettings();
pdfSettings.EmbeddedFonts = true;
report.ExportDocument(StiExportFormat.Pdf, "C:/Users/Matija/Desktop/Report.pdf", pdfSettings);
everything works fine but the fonts get embedded the wrong way like this
Snimka zaslona 2022-05-25 001513.png
Snimka zaslona 2022-05-25 001513.png (17.74 KiB) Viewed 4745 times
but when i export it via windows designer then the fonts are embedded correctly like this
Snimka zaslona 2022-05-25 001430.png
Snimka zaslona 2022-05-25 001430.png (18.3 KiB) Viewed 4745 times
Even when i call the webdesigner and export the report to pdf it again embedds the fonts the wrong way

How to correctly set the encoding and type of embedded fonts to be like encoding identity-h and type TrueType(CID)
matijasch
Posts: 2
Joined: Tue May 24, 2022 10:17 pm

Re: Issue Exporting to pdf, fonts not embedded with encoding identity-h and not with type TrueType(CID)

Post by matijasch »

I ended up adding the fonts manually and now it works as expected

Code: Select all

StiFontCollection.AddFontFile(@"C:\Windows\fonts\ARIALN.TTF", "Arial Narrow", FontStyle.Regular);
StiFontCollection.AddFontFile(@"C:\Windows\fonts\fonts\ARIALNB.TTF", "Arial Narrow Bold", FontStyle.Bold);
So i guess the web designer has no access to windows fonts
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue Exporting to pdf, fonts not embedded with encoding identity-h and not with type TrueType(CID)

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply