Examine Presentation
Aspose.Slides for Node.js via 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 JavaScript code:
var info = aspose.slides.PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
console.log(info.getLoadFormat());// PPTX
var info2 = aspose.slides.PresentationFactory.getInstance().getPresentationInfo("pres.ppt");
console.log(info2.getLoadFormat());// PPT
var info3 = aspose.slides.PresentationFactory.getInstance().getPresentationInfo("pres.odp");
console.log(info3.getLoadFormat());// ODP
Get Presentation Properties
his JavaScript code shows you how to get presentation properties (information about the presentation):
var info = aspose.slides.PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
var props = info.readDocumentProperties();
console.log(props.getCreatedTime());
console.log(props.getSubject());
console.log(props.getTitle());
// ..
You may want to see the properties under the DocumentProperties class.
Update Presentation Properties
Aspose.Slides provides the PresentationInfo.updateDocumentProperties method that allows you to make changes to presentation properties.
Let’s say we have a PowerPoint presentation with the document properties shown below.
This code example shows you how to edit some presentation properties:
let fileName = "sample.pptx";
let info = aspose.slides.PresentationFactory.getInstance().getPresentationInfo(fileName);
let properties = info.readDocumentProperties();
properties.setTitle("My title");
properties.setLastSavedTime(java.newInstanceSync("java.util.Date"));
info.updateDocumentProperties(properties);
info.writeBindedPresentation(fileName);
The results of changing the document properties are shown below.
Useful Links
To get more information about a presentation and its security attributes, you may find these links useful: