Protect your sensitive information and control document access with ease. The Syncfusion .NET PowerPoint Library lets you programmatically encrypt and decrypt presentations in C# without relying on Microsoft PowerPoint or interop dependencies.
Here is an example of how to encrypt a presentation in C# using the Syncfusion .NET PowerPoint Library.
//Open an existing presentation.
using FileStream inputStream = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read);
using IPresentation presentation = Presentation.Open(inputStream);
//Encrypt the presentation with a password.
presentation.Encrypt("password");
//Save the presentation.
using FileStream outputStream = new FileStream("Sample.pptx", FileMode.Create, FileAccess.ReadWrite);
presentation.Save(outputStream);
Here is an example of how to decrypt a password-protected presentation in C# using the Syncfusion .NET PowerPoint Library.
//Open an existing presentation.
using FileStream inputStream = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read);
using IPresentation presentation = Presentation.Open(inputStream, "password");
//Decrypt the presentation.
presentation.RemoveEncryption();
//Save the presentation.
using FileStream outputStream = new FileStream("Sample.pptx", FileMode.Create, FileAccess.ReadWrite);
presentation.Save(outputStream);
Protect a PowerPoint presentation with a password to restrict unauthorized editing.
Here is an example of how to restrict editing for presentations in C# using the Syncfusion .NET PowerPoint Library.
//Open an existing presentation.
using FileStream inputStream = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read);
using IPresentation presentation = Presentation.Open(inputStream);
//Protect the presentation with a password from unauthorized editing.
presentation.SetWriteProtection("password");
//Save the presentation.
using FileStream outputStream = new FileStream("Sample.pptx", FileMode.Create, FileAccess.ReadWrite);
presentation.Save(outputStream);
Make the PowerPoint presentation read-only to prevent readers from making inadvertent changes.
Here is an example of how to mark a presentation as final in C# using the Syncfusion .NET PowerPoint Library.
//Open an existing presentation.
using FileStream inputStream = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read);
using IPresentation presentation = Presentation.Open(inputStream);
//Mark the presentation as final.
presentation.Final = true;
//Saves the presentation.
using FileStream outputStream = new FileStream("Sample.pptx", FileMode.Create, FileAccess.ReadWrite);
presentation.Save(outputStream);
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.