This very simple article guides on how to create readonly Presentation using C#. It encapsulates all the details about the required Nuget packages, a list of step-wise programming tasks highlighting the program logic, and a runnable example code for creating a readonly presentation and preventing PPTX editing using C#. The created application can be used inside any .NET support environment in Windows, macOS, and Linux.
Steps to Create Readonly Presentation using C#
- Configure the IDE to install Aspose.Slides for .NET to create readonly PPTX using c#
- 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 aforementioned steps summarize the process to make PPTX uneditable in C# using simple API calls. The process is commenced by accessing the source presentation file from the disk or creating a new presentation from scratch using an instance of the Presentation class. Then by accessing the presentation ProtectionManager class, set the ReadOnlyRecommended property to true, which will make the presentation readonly. Finally, save the readonly presentation on the disk.
Code to Make Presentation Uneditable using C#
This example demonstrates the procedure to make Presentation uneditable using C#. The ProtectionManager class is used to secure the presentation file and exposes different properties and methods like EncryptionPassword, EncryptDocumentProperties, RemoveEncryption, and SetWriteProtection to name a few. Once the read-only property for the presentation is set, the uneditable presentation is saved on the disk.
This article has taught us to how to prevent Presentation editing using C#. If you are interested in learning the process to strike out text inside the presentation, refer to the article on how to Strike Out Text in PPTX using C#.