Encrypt, Decrypt and set Privileges on PDF documents
In order to set privileges on an existing PDF document, you can use Document->Encrypt(…) method, which takes DocumentPrivilege object. A DocumentPrivilege class is used to set different privileges to access PDF document. Furthermore, there are 4 following ways using this class:
- Using predefined privilege directly.
- Based on a predefined privilege and change some specific permissions.
- Based on a predefined privilege and change some specific Adobe Professional permissions combination.
- Mixes the way 2 and way 3.
Following code snippet will demonstrate above 4 ways to set document privileges: