// Instantiate Presentation class that represents the PPTX
Presentation pres = new Presentation();

//Write the PPTX file to disk + "Aspose-New-Presentation.pptx", SaveFormat.Pptx);


// Create skeletal package, including a MainPresentationPart and a SlideLayoutPart
PresentationMLPackage presentationMLPackage = PresentationMLPackage.createPackage(); 

// Need references to these parts to create a slide
// Please note that these parts *already exist* - they are
// created by createPackage() above.  See that method
// for instruction on how to create and add a part.
MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get(
		new PartName("/ppt/presentation.xml"));		
SlideLayoutPart layoutPart = (SlideLayoutPart)presentationMLPackage.getParts().getParts().get(
		new PartName("/ppt/slideLayouts/slideLayout1.xml"));

// OK, now we can create a slide
SlidePart slidePart = presentationMLPackage.createSlidePart(pp, layoutPart, 
		new PartName("/ppt/slides/slide1.xml")); + "Pptx4j-New Presentation.pptx"));

Download Source Code

For More Examples, Please Visit Aspose Docs

Last edited Feb 6, 2015 at 10:06 AM by shoaibkhan, version 1