Skip to main content
Version: 9.x

Set the metadata

Writes the title, author and dates a viewer shows.

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

titlestring

The title.

authorstring

The author.

subjectstring

The subject.

keywordsstring

The keywords.

creatorstring

The application that made the original document.

producerstring

The application that made the PDF.

A PDF date, such as D:20260101120000Z.

modDatestring

A PDF date.

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/set-metadata \
--form files=@report.pdf \
--form 'title=Annual report' \
--form author=Finance \
--form creationDate=D:20261001090000Z \
-o report.pdf

A field you leave out keeps its value. Dates take the PDF format: D: then the year, month, day, hours, minutes, seconds and a time zone, Z for UTC. /forms/pdf/metadata reads the metadata under the same names, so its answer feeds straight back into this route.

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=@report.pdf \
--form 'stages=[
{ "op": "set-metadata", "title": "Q3 report", "author": "Finance", "creationDate": "D:20261001090000Z" }
]' \
-o report.pdf