Skip to main content
Version: 9.x

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.xml isn't HTML, so Chromium leaves it alone, and the stage reads it.
  • The remediate stage embeds the XML and makes the PDF a Factur-X.
  • Gotenberg-Output-Filename names the result.

Variations​

  • Check it: send the PDF to /forms/pdf/validate with profile: Factur-X.
  • From Word: send invoice.docx to /forms/libreoffice/convert with the same stages.
  • Sign it: add a sign stage after remediate.
  • Send it straight to your system: add the webhook headers.