Follow this article to use picture as background in PowerPoint with Java REST API. You will learn to change background design in PowerPoint with Java REST Interface using Java-based Cloud SDK. Various options are discussed to customize the background image in the slide.
Prerequisite
- Create an account API credentials
- Download Aspose.Slides Cloud SDK for Java for setting slides background
- Setup Java project with the above SDK to set an image as background
Steps to Set PowerPoint Backgrounds with Java Low Code API
- Create the SlidesApi object for setting the background of a slide
- Upload the source PowerPoint presentation into the Cloud storage with a unique name
- Read the image file data into a byte array and convert it to a base 64 string
- Create the SlideBackground object and set the fill format for setting background image parameters
- Call the SetBackground() method to set the PowerPoint slide background
- Download the updated PowerPoint presentation after setting the background
These steps explain how to set the background for PowerPoint presentation with Java based API. Create the SlidesApi object, upload the presentation to the Cloud storage, read the image data, convert it to a base 64 string, and use it in the SlideBackground object for setting the FillFormat. Finally, call the SetBackground() method to add the image as background and download the output file on the disk.
Code to Add PPT background with Java Low Code API
This code has demonstrated how to set the background for presentation slide with Java Low Code API. You may set various properties of the image including picture fill mode, glow, inner shadow, outer shadow, soft edge, and reflection. Provide the password for the uploaded PowerPoint presentation if it is protected.
This article has taught us to set background images for PPT with Java REST Interface. If you want to copy slides within a presentation or to another presentation, refer to the article Copy PowerPoint Slide with Java REST API.