Encrypt, Decrypt and set Privileges on PDF documents

Contents
[ ]

Set Privileges on an Existing PDF File

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:

  1. Using predefined privilege directly.
  2. Based on a predefined privilege and change some specific permissions.
  3. Based on a predefined privilege and change some specific Adobe Professional permissions combination.
  4. Mixes the way 2 and way 3.

Following code snippet will demonstrate above 4 ways to set document privileges: