Open Existing Presentation in Aspose.Slides vs pptx4j
Contents
[
Hide
]
Aspose.Slides - Open Existing Presentation
Using Aspose.Slides for Java, developers can not only create PowerPoint presentations from scratch but also access or modify the existing ones.
Java
//Instantiate Presentation class that represents PPTX file
Presentation pres = new Presentation(dataDir + "presentation.pptx");
// Save presentation with chart
pres.save(dataDir + "Aspose-Duplicate.pptx", SaveFormat.Pptx);
pptx4j - Open Existing Presentation
Below example shows how existing presentation can be opened and then saved after any kind of modifications using pptx4j.
Java
String inputfilepath = dataDir + "presentation.pptx";
PresentationMLPackage presentationMLPackage =
(PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath));
System.out.println("\n\n saving .. \n\n");
presentationMLPackage.save(new java.io.File(dataDir + "Pptx4j-Duplicate.pptx"));
Download Running Code
Download Sample Code
For more details, visit Opening a Presentation and Saving a Presentation.