Skip to main content

Attachments

Embeds external files directly inside the PDF container.

Common Use Case: This is essential for e-invoicing standards like ZUGFeRD / Factur-X, which require a human-readable PDF to carry a machine-readable XML invoice as an attachment.

POST/forms/pdfengines/embed
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.
filesfile[]required
PDF files to embed content into.
embedsfile[]required
Files to embed (e.g., .xml, .png, etc.).
cURL
curl \
--request POST http://localhost:3000/forms/pdfengines/embed \
--form files=@/path/to/invoice.pdf \
--form embeds=@/path/to/factur-x.xml \
-o my.pdf
The PDF file with embedded attachments.
Content-Disposition: attachment; filename={output-filename.pdf}
Content-Type: {content-type}
Content-Length: {content-length}
Gotenberg-Trace: {trace}
Body: {output-file}