Follow this article to create custom shapes in PowerPoint with Java REST API. You will learn to automatically create and add custom shapes for PowerPoint with Java RESTful Service. It shares all the details to create a shape, set its parameters, and add to a particular slide.
Prerequisite
- Create an account API credentials
- Download Aspose.Slides Cloud SDK for Dotnet for inserting shapes in slides
- Setup Java project with the above SDK to create a shape
Steps to Add PPT Shape with Java REST API
- Create the SlidesApi object and upload the source presentation for adding shapes to it
- Specify that the slide type to modify is a Master Slide
- Create a new shape object with specific properties
- Add the new shape to the specified slide using the CreateSpecialSlideShape() method
- Download the updated presentation file with the new shape in it
These steps explain how to generate presentation shapes with Java REST API. Create the SlidesApi object, upload the presentation to the Cloud storage, specify the type of slide to be modified, and instantiate the Shape object using the desired parameters. Add the shape to the master slide and download the updated presentation with the new shape in it.
Code to Add Shape for PPT with Java REST Interface
This code demonstrates how to handle shapes for slides with Java RESTful Service. You may add any type of shapes using the enumerator GeometryShape.ShapeTypeEnum including Lines, Triangle, Rectangle, and Diamond etc. The option is also available to select other special types of slides such as LayoutSlide and NotesSlide.
This article has taught us to draw shapes on a slide. To add pictures, refer to the article Add Picture to PowerPoint with Java REST API.