This how-to topic is about how to create PowerPoint slide image using Java along with the detailed stepwise information and a working sample code. This application can be used to generate Image from PowerPoint slide in Java with no dependence on MS PowerPoint or any other third-party tool. Moreover, this application can be used in any Java supported environment including MS Windows, macOS or Linux.
Steps to Create PowerPoint Slide image using Java
- Configure the application by installing Aspose.Slides for Java using the Maven repository
- Open the sample presentation file using the Presentation class object to generate a slide image
- Load the first slide inside the presentation slides collection
- Define the customized dimensions for the slide thumbnail
- Create the slide thumbnail and save that on the disk in JPG format
In order to develop a presentation image creator Java based code performing the defined steps is demonstrated above. The process is commenced by loading the source presentation file from the disk and then accessing the desired slide from the slides collection. Finally, by using the customized dimensions inside getThumbnail() method, the slide is rendered as a JPEG image on the disk.
Code to Generate image from PowerPoint Slide in Java
The above example demonstrates the use of Java code to convert PowerPoint slide to image in JPG with the help of simple API calls. You have the provision to render the generated thumbnail as a PNG, BMP or other image formats on the disk. You may also customize the slide images by setting different rendering options like DefaultRegularFont, TiffOptions, NotesCommentsLayouting, Size and Image scaling using different overloads of the getThumbnail() method.
In this topic, we focused on how to convert PowerPoint to JPG in Java by using a simple and easy-to-understand code. If you like to know about converting presentations to HTML, refer to the article on how to create PowerPoint slides in HTML using Java.