PPTX to JPG Conversion in Java: Text in Output Images is Changed

Hello Team,

We are using Aspose.slides for JAVA to convert PPTX to JPG images, we found below issues for two of our sample files, could you please help on this?

  1. PPTFile.pptx: After converted it to slide-1.jpg, the direction of text has been changed which is highlighted with yellow colour as compared with original PPT.

  2. Figure3a.pptx: After converted it to slide-2.jpg, character “n“ from “Decision“ word moved to next line. We observed same behaviour when converted it other formats like PDF or PNG.

Sample code:

 String dir = "/Users/mb/Documents/mb/es/cfiles/ppts/";

    Presentation pres = new Presentation(dir + "Figure3a.pptx");
    try {
        for (ISlide sld : pres.getSlides()) {
            // Create a full scale image
            BufferedImage bmp = sld.getThumbnail(1f, 1f);

            // Save the image to disk in JPEG format
            ImageIO.write(bmp, "JPEG", new java.io.File(String.format(dir + "Slide_%d.jpg", sld.getSlideNumber())));
        }
    } catch (IOException e) {
    } finally {
        if (pres != null) pres.dispose();
    }

Please find attached sample files of PPTX and JPGppts.7z (212.6 KB)
.

@m.bansode
Thank you for reporting the issues.

PPTFile.pptx

I’ve reproduced the problem and added a ticket with ID SLIDESJAVA-38925 to our issue tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when the issue is resolved.

Figure3a.pptx

As I can see you are using a macOS environment for converting presentations. And it looks like no required font Calibri is installed there. Please, see what the result looks like if the required font is installed. out_Slide_1.jpg (17.2 KB)

@stanislav.miroshnichenko1,

Figure3a.pptx: We have tried conversion by installing Calibri font on mac it resolved the issue, thanks a lot!

1 Like

@m.bansode
I’m glad I could help you.

1 Like