Skip to main content
Version: 9.x

Decrypt a PDF

Opens encrypted PDFs and removes their encryption.

POST/forms/pdf/decrypt
filesfile[]required

The PDFs.

archivesfile[]

ZIP files Gotenberg unpacks: each entry counts as a file uploaded under files.

URLs Gotenberg downloads first, as if you had uploaded the files. Each entry takes a url, and optionally extraHttpHeaders.

passwordstring

The password that opens the PDFs.

The PDF, or a ZIP of the PDFs when you send several.

The route also takes the headers. An error answers a status and a message: see Errors.

curl \
--request POST http://localhost:3000/forms/pdf/decrypt \
--form files=@encrypted.pdf \
--form password=secret \
-o report.pdf

In a list of stages, decrypt comes first, and the stages after it work on the open PDF. It doesn't combine with sign or timestamp: sign the decrypted PDF in a request of its own. The read routes take a password field instead.

In a list of stages​

The stage also runs in a list on /forms/pdf/pipe, and on the PDFs a Chromium or LibreOffice conversion makes, in its stages field:

curl \
--request POST http://localhost:3000/forms/pdf/pipe \
--form files=@encrypted.pdf \
--form 'stages=[
{ "op": "decrypt", "password": "secret" }
]' \
-o decrypted.pdf