Write Metadata
Updates the XMP metadata of one or more PDF files.
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.
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.
Example Request
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
Responses
- 200
- 400
- 503
The updated PDF file.
Content-Disposition: attachment; filename={output-filename.pdf}
Content-Type: {content-type}
Content-Length: {content-length}
Gotenberg-Trace: {trace}
Body: {output-file}
The request had one ore more invalid form fields.
Content-Type: text/plain; charset=UTF-8
Gotenberg-Trace: {trace}
Body: {error}
The request did not complete within the configured maximum duration.
Content-Type: text/plain; charset=UTF-8
Gotenberg-Trace: {trace}
Body: Service Unavailable

