Skip to main content
Version: 9.x

List the form fields

Lists a form's fields, with the values each takes, in the shape set-form fills.

POST/forms/pdf/form
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.

Lists the fields on these pages only.

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.

List the fields​

curl \
--request POST http://localhost:3000/forms/pdf/form \
--form files=@fields.pdf
Response
{
"fields.pdf": [
{
"name": "agree",
"type": "checkbox",
"value": "Off",
"pages": [
1
],
"states": [
"Yes"
]
},
{
"name": "color",
"type": "combo",
"value": "Red",
"pages": [
1
],
"options": [
"Red",
"Green"
]
}
]
}

Each field comes with its fully qualified name, its type (text, checkbox, radio, button, combo, list or signature), its value, and the pages it sits on:

  • states lists what a checkbox or a radio group takes besides Off.
  • options lists what a choice field takes.
  • A list that selects several has an array value.
  • readOnly, required, multiSelect, editable and maxLength show when they apply.

A PDF without a form answers []. set-form takes the names and the values as listed.

List the fields of some pages​

pages keeps the fields on those pages, as a page selection:

curl \
--request POST http://localhost:3000/forms/pdf/form \
--form files=@multi.pdf \
--form pages=2
Response
{
"multi.pdf": [
{
"name": "total",
"type": "text",
"value": "42",
"pages": [
1,
2
],
"readOnly": true
},
{
"name": "size",
"type": "radio",
"value": "Off",
"pages": [
2
],
"states": [
"S",
"M",
"L"
],
"required": true
},
{
"name": "sig",
"type": "signature",
"value": "",
"pages": [
2
]
}
]
}