Korean Character Missing Errors & Reading a License File Error in Java on Linux

Hello,

While I am using Aspose library for converting ppt files to images, I found some issues and solved them by myself.

However, for the consistency of our service of, I want to make sure whether my solutions are appropriate in each situations.

Here are the environment where I am using the libaries.

OS : Cent OS
JDK : amazon-corretto-17
Framework : Spring Boot 3.1.2
Aspose : aspose-slides-21.4

And here are the two main issues that I experienced while using Aspose Library and questions about them.

  1. If there are Korean letters in the ppt files, Korean letters are either missing or makred as square like this ‘ㅁㅁㅁ’
  • After : I moved the fonts files in the directory of ‘/usr/share/fonts/’ in the server and it worked fine
    Q1. Should I move all the fonts file in system setting of the server all the time or there’s other way to solve the problem without it?
  1. It has the issues of readling the license file
  • Before : I used the method of the class(com.aspose.slides.License) which is 'setLicense(String namePath)
  • After : I changed the method to the ‘setLicense(InputStream namePath)’, which has the same name but a different parameter.
    Q1. The first license method with the String parameter works fine in Windows setting but not in Linux. Are those two made for each situation?
    Q2. If the answer for the first question is ‘No’, what makes the difference in this case?
    try {
            com.aspose.slides.License license = new com.aspose.slides.License();

            // It was a normal String Object before I changed it to InputStream
            InputStream path = this.getClass().getClassLoader().getResourceAsStream("Aspose.Total.Java.lic");
            logger.info("path :  " + path); 
            license.setLicense(path);
            logger.info("****Aspose.Total.Java.lic Loaded Success****");
        } catch (Exception e) {
            logger.info("****Aspose.Total.Java.lic Loaded Fail ****" + e);
        }

@borish3198,
Thank you for posting the questions.

Alternatively, you can use the FontsLoader class to load the fonts from a folder in runtime like this:

FontsLoader.loadExternalFonts(new String[] {"path_to_folder"});

More examples:

The setLicense(String) method just creates a stream itself. Both methods should work on Windows and Linux systems.

1 Like

@andrey.potapov
Thank you for the answer! It really helps me a lot.

@borish3198,
Thank you for using Aspose.Slides.