Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK'
Posted: Tue Apr 11, 2023 5:01 am
I am using "Stimulsoft.Reports.Web.NetCore" Version="2023.2.1" .I generate PDF report and everything working fine . But when I was asked to change Thai font to "THSarabun.ttf" it shows me this error :
System.Exception: Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK' step #10: 'Invalid value for 'classFormat' 0. Should be '1' or '2'.'
at Stimulsoft.Report.Export.PdfFonts.GetFontMetrics(Font font, PdfFontInfo currentFontInfo, UInt16[] glyphMap, Boolean isWpf)
at Stimulsoft.Report.Export.PdfFonts.InitFontsData(Boolean isWpf)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPdfExportSettings settings, Boolean saveFileDialog)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean exportRtfTextAsImage, String passwordUser, String passwordOwner, StiUserAccessPrivileges userAccessPrivileges, StiPdfEncryptionKeyLength keyLength, Boolean useUnicode, Boolean saveFileDialog)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean saveFileDialog)
For test you can find this font in this url :
https://www.mbu.ac.th/uncategorized/post-3573/
Also my simple form which I am using this font is attached .
System.Exception: Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK' step #10: 'Invalid value for 'classFormat' 0. Should be '1' or '2'.'
at Stimulsoft.Report.Export.PdfFonts.GetFontMetrics(Font font, PdfFontInfo currentFontInfo, UInt16[] glyphMap, Boolean isWpf)
at Stimulsoft.Report.Export.PdfFonts.InitFontsData(Boolean isWpf)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPdfExportSettings settings, Boolean saveFileDialog)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean exportRtfTextAsImage, String passwordUser, String passwordOwner, StiUserAccessPrivileges userAccessPrivileges, StiPdfEncryptionKeyLength keyLength, Boolean useUnicode, Boolean saveFileDialog)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean saveFileDialog)
For test you can find this font in this url :
https://www.mbu.ac.th/uncategorized/post-3573/
Also my simple form which I am using this font is attached .