Protect PDF using CLI
Set document privileges for PDF with AES-128 encryption. Use Aspose.PDF for Aspose.PDF CLI to modify PDF documents programmatically
How to Protect PDF File Using Using Aspose.PDF CLI Tool
In order to create a PDF file, we’ll use Aspose.PDF CLI API. The tool is powered by the Aspose.PDF for C++ library and is available for different operating systems including macOS, Linux, and Windows. You can download its versions directly from Aspose.PDF CLI App. Working with command lines is simple and clear. Just use the command line to execute specific commands related to PDF processing. Choose from a range of available functionalities (e.g., text extraction, encryption, adding watermarks, etc) to perform on the PDF.
Protect PDF using CLI
You need Aspose.PDF CLI 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