Skip to main content

Encrypt PDF

Protect a PDF with an open password and an owner password, choosing the AES key length and what readers may do (print, copy, edit, annotate, fill forms, assemble).

Command in the PDF toolkit · id ooa.pdf/encrypt · 13 inputs (2 required), no outputs

Inputs​

InputTypeRequiredDefaultWhat it is
PathFileYesPDF file.
TargetFileYesEncrypted PDF to create.
User passwordCredentialNoPassword needed to open the PDF; anyone may open it when empty.
Owner passwordCredentialNoPassword needed to change permissions; a random one nobody knows when empty, so the permissions hold.
Allow printingBooleanNotrueAllow printing.
Allow copyBooleanNotrueAllow copying text and images.
Allow modifyBooleanNotrueAllow changing the content.
Allow annotationsBooleanNotrueAllow adding comments and annotations.
Allow fill formsBooleanNotrueAllow filling in form fields.
Allow assemblyBooleanNotrueAllow inserting, rotating and deleting pages.
Allow accessibilityBooleanNotrueAllow screen readers to extract the text.
Key lengthNumberNo256AES key length in bits: 256 (recommended) or 128 for older readers.
OverwriteBooleanNotrueReplace the target when it already exists; false stops with PDF.EXISTS.