Follow this guide to learn how to add picture to PowerPoint with Java REST API. You will learn how to add a picture to a PowerPoint with Java Low Code API using a Java-based Cloud SDK. This article discusses various properties to customize the picture before adding it to the slide.
Prerequisite
- Create an account API credentials
- Download Aspose.Slides Cloud SDK for Java for inserting images into the slides
- Setup Java project with the above SDK to insert an image a slide
Steps to Add Picture in PowerPoint with Java based API
- Instantiate the SlidesApi object to insert a picture in a slide
- Upload the target presentation file where the image is to be added
- Prepare the image data in the required format
- Create the PictureFrame object for placing in a slide
- Call the CreateShape method to insert the image into a specific slide
- Download the file after adding an image to it
These steps summarize how to add a picture to PowerPoint with Java REST Interface. Upload the source presentation to the Cloud storage, prepare the image using the ToBase64String() method in the Convert namespace, and use this image to create a PictureFrame object. Finally, call the CreateShape() method to add the picture to the specified slide and download the updated presentation.
Code for Adding Pictures to PowerPoint Slides with Java REST API
This sample code demonstrates how to put picture on PowerPoint with Java RESTful Service. You can define the starting position of the picture by setting the X and Y properties in the PictureFrame object, and define the picture-filling mode using the PictureFill class object. The PictureFrame property defines the size of the image on the slide irrespective of the original size.
This article has taught us to add pictures. To add notes to a presentation, refer to the article on Add notes to powerpoint slide with Java REST API.