This topic shows, how to protect PPTX Presentation using C++ by setting a password for encryption. There are different ways one can secure the PowerPoint presentation like by applying a textual or image watermark or making it read only. In this tutorial, we’ll be programmatically setting password for protecting presentation using C++.
Steps to Lock PowerPoint Presentation in C++
- Use Aspose.Slides for C++ NuGet package
- Add reference to Aspose::Slides and Export namespaces
- Load the presentation file for protection using Presentation class instance
- Use Encrypt method exposed by ProtectionManager class to secure presentation with a password
- Save the password protected presentation using Save method and saving as PPTX
The Aspose.Slides for C++ API can help you to secure PowerPoint presentation using C++ without any reliance on Microsoft Interop or even Microsoft PowerPoint being installed on your machine.
Code to Lock PowerPoint Presentation in C++
Earlier, in another how-to topic, we have looked How to Insert Draft Watermark in PowerPoint Presentation in C#. But in the above example we have seen how to secure PPTX presentation in C++. The API also have provision to unlock the protection on presentation by removing password in C++ as well. There are few lines of code in C++ allowing you to secure your presentation.