Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Mar 03, 2021 4:40 am

os : linux(centos7)
region : korea, korean

Hi, Please Help

We are testing the conversion of Presentation files to images.
I am using the free version.(Java dependency - spire.presentation.free 3.9.0)
It works normally in a Windows environment, but it works abnormally in a Linux environment.
In the Linux environment, Hangul is overlapped and the image is saved.

Code: Select all
Presentation ppt = new Presentation();
           ppt.loadFromFile(pptFilePath);
           //Save PPT document to images
           for (int i = 0; i < ppt.getSlides().getCount(); i++) {
              BufferedImage image = ppt.getSlides().get(i).saveAsImage();
               ImageIO.write(image, "PNG", new File(imgPath + fid + ext));
           }


Josujeong
 
Posts: 3
Joined: Fri Feb 26, 2021 12:59 am

Wed Mar 03, 2021 7:30 am

Hello,

Thanks for your inquiry!

I created a runnable jar file based on your code and .pptx file, and tested it on the Linux system but did not reproduce your issue. Here I attached my testing code and runnable jar file for your reference.
Code: Select all
   public static void main(String[] args) throws Exception {
      
      String pptFilePath = "korean_example.pptx";
      String imgPath = "img";
      String ext = ".png";
      
      Presentation ppt = new Presentation();
        ppt.loadFromFile(pptFilePath);
        //Save PPT document to images
        for (int i = 0; i < ppt.getSlides().getCount(); i++) {
           BufferedImage image = ppt.getSlides().get(i).saveAsImage();
            ImageIO.write(image, "PNG", new File(imgPath + i + ext));
        }

   }

Please make sure that the fonts used in your .pptx file have been installed in your Linux system. If so, and the issue still exists, to help us reproduce your issue, please provide us with your CentOS version and localetctl status like the following screenshot. Thanks in advance!

centosStatus.png

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Wed Mar 03, 2021 8:08 am

Even if I run the jar file, it does not work properly.
You can't even apply a font.
Please check again.

Josujeong
 
Posts: 3
Joined: Fri Feb 26, 2021 12:59 am

Wed Mar 03, 2021 9:35 am

Hello,

Thanks for sharing more information!

I adjusted my CentOS system as you provided and tested your ppt file with the font “NanumGothic.ttf", but still did not reproduce your issue. Here is my system settings, jdk version and font filelist.
locale.png

jdkversion.png

fontfilelist.png

Are you using an OpenJDK or an OracleJDK? Kindly note that the OpenJDK itself has a text rendering problem, if you are using it, I recommend that you test again using OracleJDK.

If the issue still persists, please provide us with your jdk version for reference. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Thu Mar 04, 2021 6:18 am

Thank you!
When the version was upgraded, the broken Korean language problem was solved.
Batang font cannot be applied, please check!

Josujeong
 
Posts: 3
Joined: Fri Feb 26, 2021 12:59 am

Thu Mar 04, 2021 8:31 am

Hello,

Thanks for your feedback!

Glad to hear that the issue of the broken Korean language problem has been solved.

For the Batang font issue. I found that the font used in your file “korean_example_batangfont.pptx” actually is “Gungsuh” font.

fontInYourFile.png

I installed the “Gungsuh W33 Regular.ttf” font to my Linux system and then converted your file to an image, the content of the image is the same as that of your document. I also attached the screenshots of the comparison between your file and my result image and my font list in my Linux OS.

fontlist.png

compare.png


If you have any other questions, just feel free to contact us!

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Mon Mar 22, 2021 8:09 am

Hello,

Hope you are doing well!

Has the issue been solved now? Could you please give us some feedback at your convenience?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Presentation