Encrypt PDF
Try it interactively →POST /api/pdf-encryptPassword-protect a PDF. Set a user password (open document) and optionally a separate owner password (change permissions). Restrict printing, modifying, or copying.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| pdf* | file | — | Base64-encoded source PDF to encrypt. |
| userPassword* | string | — | Password the end-user types to open the document. 1–256 chars. |
| ownerPassword | string | — | Owner password for permission management. Defaults to the user password if omitted. 0–256 chars. |
| allowPrinting | boolean | true | Allow printing when opened with the user password. Default: true. |
| allowModifying | boolean | true | Allow modifying / annotating / form-filling. Default: true. |
| allowCopying | boolean | true | Allow text / image copy-out. Default: true. |
| ignoreEncryption | boolean | — | Re-encrypt an already-encrypted source. Default: false (encrypted input is rejected). |
Response
Modes: binary, json. Cache: yes (24h TTL).