Aspose.Cells substitutes existing font when save to pdf

Hello!
I have an issue when save xlsx file as pdf using Aspose.Cells 25.1.2. Standard windows font Algeria substitutes with another.
That occurs only when I set output file format to PDF, saving to xlsx causes no such problem.
File that I convert:
Xlsx_1b.zip (23.5 KB)
Conversion result:
25.1.2.pdf (102.3 KB)
Code:

      var workbook = new Workbook(SourcePath);
      workbook.Save(TargetPath, SaveFormat.Pdf);

Saving to PDF/A-1b gives the same result, font substitutes.
Algeria font is installed for all users on my machine. Problem occurs for both OS, Windows or Linux.
I’d like to know how to convert this xlsx file to pdf without font substitution. Could you please give me some advice how to do it?

@directum
From the PDF result file, it appears that the program did not find the corresponding fonts when saving to PDF. You can use FontConfig.SetFontFolder method to set custom fonts. Also, please note that to ensure successful setting of custom fonts, please place the code for setting custom fonts before loading the workbook. Please check the following document.

Thank you for quick answer!
We didn’t change the code, we didn’t change Aspose.Cells version, but sometimes this code works perfectly, and sometimes it fails. Environment is the same, so I wonder what else could be the cause of this problem.
Example of normal conversion:
normal.pdf (105.2 KB)

@directum
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-57819

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

@directum ,

It seems that there are more than one “Algerian” font files on your environment. e.g. one can render the text in Cell A3 in “Шрифты” sheet, but the other one can’t. On our side, the default installed “Algeria” font can’t render your text:
Screenshot_Algeria_font.jpg (362.0 KB)

Could you please share the “Algerian” font file(s) on your side? Also, which .net does your project target? .net6.0, net8.0 or .Net Framework 4? If possible, please share us the project file.

You’re right—the problem was with the font that is installed in the system. If the Algerian font in the system supports Cyrillic, the PDF is generated with the correct font; otherwise, if the font only supports Latin, the font in PDF will be substituted.
That settles the issue. I think you can close the ticket. Thanks for your time!

@directum
Thank you for your feedback. I am glad that you have resolved this issue by installing the necessary fonts. If you have any questions, please feel free to contact us at any time.