Clone PPT Slide using Aspose.Slides

Aspose.Slides - Clone PPT Slide

There are several possible ways to clone a slide:

  • Cloning a slide from one position to the end of the slides within the same presentation.
  • Cloning a slide from one position to another position within the same presentation.
  • Cloning a slide from one presentation to another one at the end of the existing collection of slides.
  • Cloning a slide from one presentation to another one at a specified position.
  • In Another presentation with a master slide from the source presentation at the end of the existing slides.

In Aspose.Slides for Java, SlideCollection (a collection of Slide objects) exposed by the Presentation object provides the AddClone and InsertClone methods to perform the above types of slide cloning.

Java

 //Instantiate Presentation class that represents a PPTX file

Presentation pres = new Presentation(dataDir + "presentation.pptx");

//Clone the desired slide to the end of the collection of slides in the same PPTX

ISlideCollection slds = pres.getSlides();

slds.addClone(pres.getSlides().get_Item(0));

Download Running Code

Download Sample Code