Encrypting and decrypting PDF files

Learn how to encrypt and protect, and decrypt PDF files.

Encrypt and protect a PDF file

Add protection and encryption to a PDF file by adding the Encrypt PDF File (encryptPdf) command to your script. You can use the AES 128-bit, AES 256-bit, or ARC4 algorithms to encrypt the PDF file, and protect it by defining the restrictions available with an owner password and user password:

  • Owner password
    The owner password permits full access to a PDF file. Define this password to apply restrictions on data extraction, data modification, content interaction, or printing operations for a PDF file.

  • User password
    The user password protects against unauthorized access to a PDF file. Define this password to restrict permissions to data extraction, data modification, content interaction, or printing operations for a PDF file.

Restrict printing operations

In the Encrypt PDF File (encryptPdf) command, from the Printing parameter's list, select the option to restrict printing operations: permit the document printing, or restrict the document printing or restrict it only at the highest-quality level.

Restrict data extraction

In the Encrypt PDF File (encryptPdf) command, from the Extract data parameter's list, select the option to restrict data extraction: permit or restrict data extraction from the PDF file, or permit PDF Viewers to access the PDF file contents by using the Viewer’s accessibility features.

Restrict data modification

In the Encrypt PDF File (encryptPdf) command, from the Modification parameter's list, select the option to restrict data modification: permit or restrict document modification and assembling, or permit only document assembling such as inserting, rotating, or deleting pages, and bookmark creation on the navigation pane.

Restrict content interaction

In the Encrypt PDF File (encryptPdf) command, from the Interactivity parameter's list, select the option restrict content interaction: permit or restrict interactive operations such as adding or modifying text, and filling form fields in the PDF file, or restrict interactive operations in the PDF file except filling existing form fields and document signing.

Decrypt a PDF file

Decrypt and remove the protection of a PDF file by adding the Decrypt PDF File (decryptPdf) command to your script.