Aspose.Slides

//Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("data/pptx4j/presentation.pptx");

//Accessing a slide using its index in the slides collection
ISlide slide = pres.getSlides().get_Item(1);

//Removing a slide using its reference
pres.getSlides().remove(slide);

//Removing a slide using its slide index
pres.getSlides().removeAt(0);

PPTX4J

String inputfilepath = "data/pptx4j/presentation.pptx";

PresentationMLPackage presentationMLPackage = 
	(PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath));

MainPresentationPart mpp = presentationMLPackage.getMainPresentationPart();

//mpp.removeSlide(10);
Relationship rel = mpp.getRelationshipsPart().getRelationshipByID("rId2");
mpp.removeSlide(rel);


Download Source Code

For More Examples, Please Visit Aspose Docs

Last edited Aug 19, 2014 at 11:42 AM by shoaibkhan, version 2