This article entails how to read the Presentation properties in Java by following the detailed steps to set up the environment and use the step-by-step runnable sample code. The code example can be used in any of Java configured environments including Windows, Linux or macOS to read PPTX document properties in Java using a simple API interface.
Steps to Read PPTX Document Properties in Java
- Set up the environment to add Aspose.Slides for Java from the repo to read the presentation properties
- Add an instance of the IPresentationInfo to access the presentation info collection from the presentation factory
- Create the IDocumentProperties object to read the presentation document properties from the presentation info instance
- Read and print the document properties for the presentation
By following the above steps in Java Presentation document properties can be read and managed using simple API calls whereby you will access the presentation information from the presentation factory using a static PresentationFactory class instance that doesn’t really need to load the presentation inside the DOM of the API. Then, by using the IDocumentProperties class object, the properties are read and printed inside the console. Moreover, you can also write or modify the data inside the accessed document properties as per your requirements.
Code to Read Presentation Properties in Java
In the above code, you can read presentation properties in Java using a very simple API interface. When you will access the presentation document properties using the PresentationFactory class the entire presentation is not loaded inside the Document Object Model and you will observe a very small memory footprint. The DocumentProperties class not only enables you to modify the pre-defined presentation properties but also lets you add and access the custom document properties.
This topic focused on how to read presentation properties using Java. If you are interested to learn about signing a presentation, refer to the article on how to add Signature in PowerPoint using Java.