Fonts Are Getting Distorted and Overwritten in Slides after Importing PPT

Hi Team,
The original ppt looks all good but when we are trying to import it to our tool using aspose slides in java we are seeing the fonts are getting smashed.
the original slides:
image.jpg (56.0 KB)
image.jpg (93.3 KB)
the imported slides are attached below:
image.png (80.9 KB)

image.png (29.0 KB)

Can anyone please look into this issue?

@bpradhan,
Thank you for contacting support.

We need more details to investigate the case and help you. Please share the following files and information:

  • original presentation file
  • code example that creates the presentation with the distorted fonts
  • output presentation file
  • OS version on which the code was executed
  • JDK target version in your app
  • Aspose.Slides version you used

Before that, please check if the fonts used in the presentation are installed in the OS on which the code was executed. You can also load them in runtime.
Custom PowerPoint Font in Java|Aspose.Slides Documentation

Hi Andrey,
Thanks for reaching out. I have attached the PPT file and provided the info as below which you needed

code example that creates the presentation with the distorted fonts -

FontsLoader.loadExternalFonts(new String[]{"pathToCustomFontsLocations"});
LoadOptions loadOptions = new LoadOptions(LoadFormat.Auto);
loadOptions.setDefaultRegularFont("Arial");
loadOptions.setDefaultAsianFont("Arial");
Presentation presentation = new Presentation("FilePath", loadOptions);
int i = 0;
for (ISlide iSlide: presentation.getSlides()) {
    Dimension2D slideSize = presentation.getSlideSize().getSize();
    Dimension dimension = new Dimension();
    dimension.setSize(slideSize.getWidth(), slideSize.getHeight());
    BufferedImage thumbnail = iSlide.getThumbnail(dimension);
    String outputFileName = "output" + i++ + ".png";
    File outputFile = new File(outputFileName);
    try {
        ImageIO.write(thumbnail, "png", outputFile);
    } catch (IOException e) {
        System.out.println("Failed to write image to file: " + e.getMessage());
    }
}
  1. output presentation file - Issue in thumbnail generated not ppt file

  2. OS version on which the code was executed: Linux ip-172-18-24-66.eu-central-1.compute.internal 5.10.210-201.852.amzn2.x86_64 #1 SMP Tue Feb 27 17:09:32 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

  3. JDK target version in your app: openjdk version “1.8.0_402”
    OpenJDK Runtime Environment (build 1.8.0_402-b06)
    OpenJDK 64-Bit Server VM (build 25.402-b06, mixed mode)

  4. Aspose.Slides version you used - 23.11

image.png (451.3 KB)

SamplePPT.pptx.zip (2.2 MB)

Not able to upload the full ppt despite having only 14 MB because of some error so i have attached only few slides of the PPT.

If you need any further details please reach out to us. Thank you!!

@bpradhan,
Thank you for the details. Could you kindly also share the external fonts you loaded using the FontsLoader.loadExternalFonts method and your output images?

You can share a link to the files saved in a file storage (Google Drive, Dropbox, etc).

Hi @andrey,
Uploading the zip file which contains the fonts zip file which are used in that slide and also uploaded the sample PPT file for which we are seeing the issue.

Added the slide thumbnails also after they got generated using the code.
https://drive.google.com/drive/folders/10zbtx_tmRrPcWyg92_43cMyTddeLd1sL?usp=drive_link

@bpradhan,
Thank you for the files.

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): SLIDESJAVA-39452

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.