Custom fonts not applied in exported PDF
Posted: Sat Dec 19, 2020 3:51 pm
Hi,
In the designer, the font is perfectly displayed.
The font is a ttf file.
Here is my code
the output file looks like the attached file
How can we solve this issue, please?
In the designer, the font is perfectly displayed.
The font is a ttf file.
Here is my code
Code: Select all
StiPdfExportSettings pdfSettings = new StiPdfExportSettings();
pdfSettings.EmbeddedFonts = true;
report = StiReport.GetReportFromAssembly(assemplyfile);
StiOptions.Export.Pdf.AllowImportSystemLibraries = true;
report.RegData("CertificateData", certificateData);
await report.RenderAsync();
StiOptions.Export.Pdf.AllowImportSystemLibraries = true;
var service = new StiPdfExportService();
var stream = new MemoryStream();
service.ExportTo(report, stream, pdfSettings);
var streamArray = stream.ToArray();
System.IO.File.WriteAllBytes(certificateFile, streamArray);
How can we solve this issue, please?