This very basic topic guides on how to create readonly Presentation using Python. It covers all the details about the required PYPI packages, a list of step-wise programming tasks highlighting the program logic, and a runnable example code for generating a read-only presentation and preventing PPTX editing using Python. The developed application can be used inside any .NET and Python supported environment in macOS, Windows, and Linux.
Steps to Create Readonly Presentation using Python
- Configure the IDE to use Aspose.Slides for Python via .NET to create read-only PPTX using Python
- Access the target PPTX presentation file using an instance of the Presentation class
- Access the presentation ProtectionManger class set True for the ReadOnlyRecommended property value
- Save the uneditable and read only presentation file on the disk
The above mentioned steps explain the process to make PPTX uneditable in Python using a few API calls. The process will be initiated by opening the target presentation file from the disk or generating a new presentation from scratch using an instance of the Presentation class. The ProtectionManager class instance will then be accessed from presentation properties and the True value will be set for the ReadOnlyRecommended property, which will convert the loaded presentation to have read-only access only before saving that on the disk.
Code to Make Presentation Uneditable using Python
The above code example demonstrates the simple process to make Presentation uneditable using Python. The ProtectionManager class instance is used to restrict the presentation file editing and it also exposes other different properties and methods like EncryptDocumentProperties, EncryptionPassword, RemoveEncryption, and SetWriteProtection to name a few. You can also reset the presentation protection to allow the edit by removing the read-only property and setting its value to False.
This example has taught us to how to prevent Presentation editing using Python. If you want to learn about how to strike out text inside the presentation, refer to the article on how to Strike Out Text in PPTX using Python.