Clone a Shape from Another Slide

Introduction

Aspose.Slides Cloud API allows you to clone (copy) a shape from one slide to another within the same presentation. The CreateShape method — described in detail in Add a Shape to a Slide — accepts a cloneFromSlide query parameter that, when combined with shapeToClone, identifies the source slide. The shape at position shapeToClone on slide cloneFromSlide is copied to the target slide. Without cloneFromSlide, shapeToClone clones from the same slide.

API Information

API Type Description Resource
/slides/{name}/slides/{slideIndex}/shapes POST Adds a shape to a presentation slide, optionally cloning it from a different slide. CreateShape

Request Parameters

Name Type Location Required Description
name string path true The name of a presentation file.
slideIndex integer path true The 1-based index of the target slide.
shapeToClone integer query false The 1-based index of the shape to be cloned.
cloneFromSlide integer query false The 1-based index of the slide that contains the shape to clone. When omitted, the shape is cloned from the slide specified by slideIndex.
position integer query false The 1-based index of the position for the new shape. By default, the shape is added to the end.
password string header false The password to open the presentation.
folder string query false The path to the folder containing the presentation.
storage string query false The name of the storage containing the folder.

Example

Clone the second shape from slide 3 and add it to slide 1 in MyFolder/MyPresentation.pptx stored in the default storage.

cURL Solution

SDK Solutions

SDKs

Check Available SDKs to learn how to add an SDK to your project.