Text breaks when converting Excel to PDF in a Linux environment

Japanese characters are broken when saving an Excel file made using Aspose Cells as a PDF. Do you know the cause or solution?
environment is AlmaLinux.

@Munkyeong_Lee,
Would you like to provide the sample file? We will check it soon.

@John.He
request.7z (78.6 KB)
image.png (3.0 KB)
I uploaded the file and version that I used. Please check.

@Munkyeong_Lee,
Through testing, we can obtain the correct result. Please check the attachment (79.4 KB).
You got incorrect result, which should be that the font “MSP ゴシック” is not installed on the machine.
If you still cannot obtain the correct result after installing the font. You can refer to the following documents to set the font path.

Would you like to install the font first and then retest it?

1 Like

@Munkyeong_Lee,

Thanks for the sample files and screenshot.

I tested your scenario/case and it works fine. It seems your issue is related to missing fonts on your Linux machine/environment. Your problem is occurring because of missing fonts (e.g.,MS-PGothic, MalgunGothic, MicrosoftYaHeiLight and others with all its flavors) in your environment. When you will have all the required fonts installed in our environment, your issue would be resolved. Please note the underlying fonts used in the workbook should be installed and you need to set fonts folder in your code at the start. Please copy/collect all the required fonts and place them in some directory on your machine. Suppose, you have placed the fonts in /usr/temp/myFonts directory, then set the fonts folder as below.

String fontFolder="/usr/temp/myFonts";
//fontFolder = "C:/temp/myFonts";//This is for Windows <<<
FontConfigs.setFontFolder(fontFolder, true);

Please note, you must execute this code before you execute any other Aspose.Cells code. For more information, please see these article.
Configuring Fonts for Rendering Spreadsheets

Let us know if you still have any issue.

1 Like