Convert PowerPoint PPTX to JPG Images using Java

PPTX to JPG Java

MS PowerPoint presentations can not be displayed directly from within the web or desktop applications. One of the possible solutions is converting the slides in a PPTX presentation to the images such as JPEG or PNG. In accordance with the above-mentioned scenario, this article will show you how to convert slides in a PPTX to JPG images using Java.

TIP:

To see a implementation of the conversion process described here, you may want to check out Aspose online PPT to JPG converter.

Java PPTX to JPG Image Conversion API

Aspose.Slides for Java is a presentation manipulation API that lets you implement PowerPoint automation features from within your Java applications. In addition, it also provides a PPTX to JPG image converter API to generate thumbnails of the slides in a presentation. You can either download the API or get it installed using the Maven configuration.

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>
<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <classifier>jdk16</classifier>
</dependency>

PPTX to JPG Java Conversion

In order to convert the PPTX slides to JPG, you can simply loop through the slides in a presentation and save each of them as a JPG file. The following are the steps to perform this operation.

The following code sample shows how to convert PPTX slide to JPG image using Java.

PowerPoint PPTX

PowerPoint PPTX

Converted JPG Images

Java PPTX to JPG Conversion

Java PPTX to JPG – Customize Image Dimensions

You can also customize the dimensions to scale the converted JPG images as per your desires. The following are the steps to specify the Scale X and Scale Y values in PPTX to JPG conversion.

The following code sample shows how to apply customized scaling in PPTX to JPG conversion.

Conclusion

In this article, you have learned how to convert slides in PPTX to JPG images using Java. Furthermore, you have seen how to apply the desired scaling to the images in PPTX to JPG conversion. You can learn more about the Java presentation manipulation API using documentation.

See Also