Skip to main content
Version: 9.x

Read the info

Reads the page count, the PDF version, and whether a PDF is encrypted, tagged, linearized or holds form fields.

POST/forms/pdf/info
filesfile[]required

The PDFs.

passwordstring

Opens encrypted PDFs. A wrong one answers 400, and so does a missing one when the PDF has a user password.

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.

JSON, one entry per PDF under its file name.

The route answers directly: it ignores Gotenberg-Output-Filename, and answers 400 to the webhook headers. An error answers a status and a message: see Errors.

curl \
--request POST http://localhost:3000/forms/pdf/info \
--form files=@report.pdf
Response
{
"report.pdf": {
"pages": 3,
"version": "1.7",
"encrypted": false,
"tagged": false,
"linearized": false,
"formFields": false
}
}

tagged says whether the PDF carries a structure for screen readers, and linearized whether it's built for fast web view. Each PDF answers under its name.

Read an encrypted PDF​

Every read route takes a password field to open encrypted PDFs. A wrong one answers 400, and so does a missing one when the PDF has a user password; a PDF with an owner password only opens without it:

curl \
--request POST http://localhost:3000/forms/pdf/info \
--form files=@encrypted.pdf \
--form password=secret
Response
{
"encrypted.pdf": {
"pages": 3,
"version": "1.7",
"encrypted": true,
"tagged": false,
"linearized": false,
"formFields": false
}
}