Skip to main content

Encrypt PDFs

Encrypts one or more PDF files with a user and/or owner password.

Set passwords to control PDF access. The user password is required to open the PDF; the owner password controls permissions (printing, copying, editing).

Encryption strength (e.g., AES-256) depends on the active PDF Engine. See PDF Engines Configuration.

POST/forms/pdfengines/encrypt
Headers
Gotenberg-Output-Filenamestring
The filename of the resulting file - Gotenberg automatically appends the file extension. Defaults to a random UUID filename.
Gotenberg-Tracestring
A custom request ID to identify the request in the logs; overrides the default UUID.
Form Fields
userPasswordstringrequired
The password required to open the PDF.
ownerPasswordstring
The password required to change permissions or edit the PDF.
Form Files
filesfile[]required
PDF files to encrypt.
cURL
curl \
--request POST http://localhost:3000/forms/pdfengines/encrypt \
--form files=@/path/to/file.pdf \
--form userPassword=open \
--form ownerPassword=manage \
-o my.pdf
The encrypted PDF file.
Content-Disposition: attachment; filename={output-filename.pdf}
Content-Type: {content-type}
Content-Length: {content-length}
Gotenberg-Trace: {trace}
Body: {output-file}
Sponsors
TheCodingMachinepdfmePdfBolt
Powered by
DockerJetBrains