This simple topic focuses on how to create readonly Presentation using Java by exposing all the details about the required JAR files, a list of programming tasks describing the program logic, and an executable example code for generating a readonly presentation and preventing PPTX editing using Java. The developed application can be used inside any of Java supported applications inside Windows, macOS, and Linux.
Steps to Create Readonly Presentation using Java
- Configure the IDE to install Aspose.Slides for Java from the repository manager to create readonly PPTX using Java
- Open the required source PPTX presentation using an instance of the Presentation class
- Access the presentation ProtectionManger class and set the ReadOnlyRecommended property to true
- Save the resultant readonly presentation on the disk
The above steps explain the process to make PPTX uneditable in Java using a simple API interface. The process is initialized by loading the source PPTX presentation file from the disk or creating a new empty presentation from scratch using the Presentation class object. Then by using an instance of the presentation ProtectionManager class, the ReadOnlyRecommended property will be set to true, which will make the entire presentation readonly. Finally, the uneditable presentation will be saved on the disk.
Code to Make Presentation Uneditable using Java
This example entails the process to make Presentation uneditable using Java. It makes use of the ProtectionManager class to secure the presentation file and exposes different getter and setters methods to set the EncryptionPassword, RemoveEncryption, EncryptDocumentProperties, and setWriteProtection to name a few. After setting the setter for read-only property to true, the presentation will become uneditable and will be saved on the disk.
This article has exhibited how to prevent Presentation editing using Java. If you want to learn about the process of striking out text inside the presentation, refer to the article on how to Strike Out Text in PPTX using Java.