Convert PPTX to GIF in Java

Render PPTX slides as GIF images using Aspose.Slides for Java without Microsoft PowerPoint.

Convert PPTX to GIF Using Java

Use Aspose.Slides for Java to load a PPTX presentation and render each slide as a GIF image. You can install the aspose-slides package in a Maven-based project by adding the repository and dependency below.

Repository

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://releases.aspose.com/java/repo/</url>
</repository>

Dependency

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <version>26.8</version>
    <classifier>jdk16</classifier>
</dependency>

PPTX to GIF Java Conversion Source Code

Presentation presentation = new Presentation("presentation.pptx");
try {
    for (ISlide slide : presentation.getSlides()) {
        IImage slideImage = slide.getImage(1f, 1f);
        try {
            slideImage.save("slide_" + slide.getSlideNumber() + ".gif", ImageFormat.Gif);
        } finally {
            slideImage.dispose();
        }
    }
} finally {
    presentation.dispose();
}

How to Convert PPTX to GIF via Java

Java developers can render PPTX slides as GIF images in just a few lines of code.

  1. Load the PPTX file with the Presentation class.
  2. Iterate through the ISlide objects in the presentation.
  3. Call the getImage method for each slide.
  4. Save each IImage object with ImageFormat.Gif.

System Requirements

Before running the Java conversion sample code, make sure that you have the following prerequisites.

  • Microsoft Windows, Linux, macOS, or another OS with a supported Java Runtime Environment.
  • Get the latest version of Aspose.Slides for Java from Maven.

Built with Aspose.Slides

Convert PPTX to GIF Online

The free Aspose.Slides Conversion app is built with Aspose.Slides for Java, the same API as the code above. Open it and see what the API can do with your own PPTX files.

  • Runs in your browser, nothing to install.
  • See how Aspose.Slides converts files before you write code.
  • Upload PPTX files and save them as GIF.
  • Download the result or convert more files.