Convert PowerPoint PPTX/PPT to PNG Images in Java

The conversion of PowerPoint presentations to image formats could be used in various scenarios. For example, to display the presentations in your web or desktop applications, to generate thumbnails, etc. Since PNG is one of the most popular image formats, in this article, you will learn how to convert slides in PowerPoint PPTX or PPT to PNG images using Java.

Java API for PowerPoint to PNG Conversion

For PPTX or PPT to PNG conversion, we will use Aspose.Slides for Java. The API lets you create, manipulate and convert PowerPoint and OpenOffice presentations from within the Java applications. You can either download the API or install it using the following Maven configurations.

    <name>Aspose Java API</name>

Convert PowerPoint PPTX or PPT to PNG in Java

The following are the steps to convert slides in a PowerPoint PPTX to PNG images using Java.

  1. First, create an instance of the Presentation class to load the presentation.
  2. Define the dimensions of the resultant PNG image.
  3. Loop through each ISlide in Presentation.getSlides() collection.
  4. Generate image of the each slide using ISlide.getThumbnail(float ScaleX, float ScaleY) method and get the reference of image into a BufferedImage object.
  5. Create a new File for the output PNG image.
  6. Finally, save the PNG image using ImageIO.write(BufferedImage, String, File) method.

The following code sample shows how to convert a PowerPoint PPTX to PNG.

Get a Free API License

You can use Aspose.Slides for Java without evaluation limitations by requesting a temporary license.

Online Demo

Try the online PowerPoint to PNG converter, which is based on Aspose.Slides.


In this article, you have learned how to convert slides in PowerPoint PPTX or PPT to PNG using Java. You can simply install the API and use the provided code in your Java applications. In addition, you can visit the documentation to explore other features of API. Also, you can feel free to let us know about your queries via our forum.

See Also