Page 1 of 1

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

Posted: Tue May 24, 2022 10:42 pm
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 4893 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 4893 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)

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

Posted: Thu May 26, 2022 7:32 am
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

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

Posted: Thu May 26, 2022 12:54 pm
by Lech Kulikowski
Hello,

Thank you for the information.