Examine Presentation
Aspose.Slides for Java allows you to examine a presentation to find out its properties and understand its behavior.
Info
The PresentationInfo and DocumentProperties classes contain the properties and methods used in operations here.Check a Presentation Format
Before working on a presentation, you may want to find out what format (PPT, PPTX, ODP, and others) the presentation is in at the moment.
You can check a presentation’s format without loading the presentation. See this Java code:
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
System.out.println(info.getLoadFormat()); // PPTX
IPresentationInfo info2 = PresentationFactory.getInstance().getPresentationInfo("pres.ppt");
System.out.println(info2.getLoadFormat()); // PPT
IPresentationInfo info3 = PresentationFactory.getInstance().getPresentationInfo("pres.odp");
System.out.println(info3.getLoadFormat()); // ODP
Get a Presentation Properties
This Java code shows you how to get a presentation’s properties (information about the presentation):
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
IDocumentProperties props = info.readDocumentProperties();
System.out.println(props.getCreatedTime());
System.out.println(props.getSubject());
System.out.println(props.getTitle());
// ..
You may want to see the properties under the DocumentProperties class.
Update a Presentation Properties
Aspose.Slides provides the PresentationInfo.updateDocumentProperties method that allows you to make changes to a presentation’s properties.
This Java code shows you how to edit a presentation’s properties:
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
IDocumentProperties props = info.readDocumentProperties();
props.setTitle("My title");
info.updateDocumentProperties(props);
Useful Links
To get more information about a presentation and its security attributes, you may find these links useful: