This article guides on how to extract pictures from PowerPoint with Java REST API. You will learn to automatically retrieve images on PowerPoint with Java REST Interface using a Java-based cloud SDK. It will share details to extract all the images or fetch selected images from the presentation.
Prerequisite
- Create an account API credentials
- Download Aspose.Slides Cloud SDK for Java to retrieve images from the presentation
- Setup Java project with the above SDK for extracting pictures
Steps to Extract PowerPoint Pics with Java REST API
- Initialize the SlidesApi object to extract pictures using the Client ID and secret
- Upload the PowerPoint file with images to Aspose cloud storage
- Download all the images from the PowerPoint presentation in a ZIP file using the DownloadImagesDefaultFormat() method
- Save the ZIP file containing all extracted images to the local storage
- Download a single image from the PowerPoint presentation
- Save the extracted single image as a PNG file to the local storage
These steps describe how to fetch PowerPoint presentation images with Java Java-based API. Initialize the SlidesApi object, upload the presentation to the server, download all the images as a ZIP stream from the API response, and save them on the disk. Use the DownloadImageDefaultFormat() method to fetch the desired image only by providing the image index in the presentation.
Code to Extract Pictures in Presentations with Java RESTful Service
This code demonstrates how to extract pictures from PowerPoint with Java Low Code API. The DownloadImagesDefaultFormat() method takes the presentation file name and returns a ZIP stream that is saved on the local storage. All the files in the ZIP file contain the default image type.
This article has taught us the extraction of PowerPoint slides images with Java REST Interface. To add a watermark in a presentation, refer to the article Add watermark to PPT with Java REST API.