Unlock PPTX Presentation in C#
Remove protection from PPTX using .NET library.
Unlock PPTX File Using C#
In order to remove protection PPTX file, we’ll use
API which is a feature-rich, powerful and easy to use document protection API for C# platform. Open
package manager, search for Aspose.Slides and install. You may also use the following command from the Package Manager Console.
PM> Install-Package Aspose.Slides.NET
Unlock PPTX via C#
You need aspose.slides.dll referenced in your project to execute the following workflow.
Load locked PPTX with an instance of Presentation
Check protection using IProtectionManager.IsWriteProtected boolean type property
Remove protection using the IProtectionManager.RemoveWriteProtection method
Save result in PPTX format
Aspose.Slides for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms
- Development environment like Microsoft Visual Studio
- Aspose.Slides for .NET referenced in your project
// load locked PPTX file var presentation = new Slides.Presentation("locked.pptx"); // check if presentation is write protected if (presentation.ProtectionManager.IsWriteProtected) // remove protection presentation.ProtectionManager.RemoveWriteProtection(); // save presentation presentation.Save("output.ppt", Aspose.Slides.Export.SaveFormat.Pptx);