E-invoice from an HTML template
You have an invoice as HTML, and its data as Factur-X XML. You want one PDF that people read and accounting software parses, under the invoice's number.
Request
curl \
--request POST http://localhost:3000/forms/chromium/convert/html \
--form files=@index.html \
--form files=@style.css \
--form files=@invoice.xml \
--form 'stages=[
{ "op": "remediate", "profile": "Factur-X", "xml": "invoice.xml", "level": "EN 16931" }
]' \
--header 'Gotenberg-Output-Filename: invoice-2026-0042' \
-o invoice-2026-0042.pdf
Response
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="invoice-2026-0042.pdf"
Gotenberg-Remediation-Residual: 0
Gotenberg-Remediation-Rolled-Back: 0
Result
invoice-2026-0042.pdf, a PDF/A-3 that carries invoice.xml as factur-x.xml. Gotenberg-Remediation-Residual: 0 says it conforms.
How it works
- Chromium prints the HTML as on the HTML route.
invoice.xmlisn't HTML, so Chromium leaves it alone, and the stage reads it. - The
remediatestage embeds the XML and makes the PDF a Factur-X. Gotenberg-Output-Filenamenames the result.
Variations
- Check it: send the PDF to
/forms/pdf/validatewithprofile: Factur-X. - From Word: send
invoice.docxto/forms/libreoffice/convertwith the samestages. - Sign it: add a
signstage afterremediate. - Send it straight to your system: add the webhook headers.