Replace Picture in PowerPoint with Java REST API

This article guides on how to replace picture in PowerPoint with Java REST API. You will learn how to replace picture in PowerPoint with Java REST Interface using the Java-based Cloud SDK. It will provide complete details to upload the source files and download the modified files from the Cloud storage.

Prerequisite

Steps to Replace Image in PPT with Java Java-based API

  1. Initialize the SlidesApi class object to replace the picture
  2. Upload the target presentation with some images in it for replacement
  3. Load the source image into a Stream object to add it to the presentation
  4. Invoke the ReplaceImage() method by providing the presentation name, target image index, and new image stream
  5. Download the modified presentation with a new image

The steps describe how to replace picture in PowerPoint with Java REST Interface. Upload the source presentation to the Cloud storage, read the desired image into the Stream object, and call the ReplaceImage() method with the required arguments. Subsequently, call the DownloadFile method to fetch the updated presentation.

Code to Replace Picture in PPT with Java REST API

This code has demonstrated how to change picture shape in PowerPoint with Java RESTful Service. If you do not upload the presentation file to the Cloud storage, it will use any available presentation with the same name from the Cloud storage. You may get different results if you use the existing file name from the Cloud storage uploaded earlier in some other session.

This article has taught us the process of replacing an image in a presentation. To add a new picture, refer to the article on Add Picture to PowerPoint with Java REST API.

 English