Skip to main content
Version: 9.x

List the attachments

Lists the files embedded in a PDF.

POST/forms/pdf/attachments
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/attachments \
--form files=@invoice.pdf
Response
{
"invoice.pdf": [
{
"name": "factur-x.xml",
"mimeType": "text/xml",
"relationship": "Alternative"
}
]
}

Each file comes with its name, and with its media type and its relationship to the document when the PDF states them. attach embeds files, and detach removes one by the name listed here.