Protect PDF via C#
Set document privileges for PDF with AES-128 encryption. Use Aspose.PDF for .NET to modify PDF documents programmatically
How to Protect PDF File Using Using .NET Tool
In order to protect PDF file, we’ll use Aspose.PDF for .NET API which is a feature-rich, powerful and easy to use document manipulation API for net platform. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console.
Protect PDF via C#
You need Aspose.PDF for .NET to try the code in your environment.
- Load the PDF with an instance of Document.
- Create an object of DocumentPrivilege & set options.
- Call Document.Encrypt method to protect PDF with AES-128.
- Save result in PDF format