Skip to main content

Write Metadata

Updates the XMP metadata of one or more PDF files.

See the PDF Engines module configuration for engine selection flags.

Inject XMP metadata (Author, Title, Copyright, Keywords, etc.) into the PDF as a JSON object.

Not all tags are writable. Gotenberg uses ExifTool under the hood. See the XMP Tag Name documentation for valid keys. Writing metadata usually breaks PDF/A compliance.

Basics

POST/forms/pdfengines/metadata/write
Headers
Gotenberg-Output-Filenamestring
The filename of the resulting file - Gotenberg automatically appends the file extension. Defaults to a random UUID filename.
Gotenberg-Tracestring
A custom request ID to identify the request in the logs; overrides the default UUID.
Form Fields
metadatajsonrequired
The metadata to write (JSON format). e.g. {"Author": "Gotenberg"}
Form Files
filesfile[]required
PDF files to update.
cURL
curl \
--request POST http://localhost:3000/forms/pdfengines/metadata/write \
--form files=@/path/to/file.pdf \
--form 'metadata={"Author":"Gotenberg","Producer":"Gotenberg","Keywords":["guide","documentation"]}' \
-o my.pdf
The updated PDF file. Multiple input files produce a ZIP archive.
Content-Disposition: attachment; filename={output-filename.ext}
Content-Type: {content-type}
Content-Length: {content-length}
Gotenberg-Trace: {trace}
Body: {output-file}

What's Next?

Read it back with Read metadata, or browse every available route.