Skip to content

Generate invoice PDF

The "Generate invoice PDF" service task combines automatic amount calculation with PDF generation in a single step. First, all invoice amounts are calculated (net, gross, VAT), then a PDF document is rendered from a Handlebars template. This turns raw invoice data directly into a fully formatted PDF document.


How it works

The task internally performs two steps:

  1. Amount calculation — Line item totals, VAT, and grand totals are automatically computed (same as Calculate invoice amounts).
  2. PDF generation — The calculated data is inserted into an HTML template and rendered as a PDF (same as Generate PDF from Handlebars template).

Input parameters

The invoice data is provided as input. The HTML template and filename are configured in the process designer.

{
  "app_invoice_no": "INV-2026-001",
  "app_invoice_date": "2026-04-08",
  "app_recipient_name": "Sample Corp",
  "app_invoice_items_custom": [
    {
      "app_item_description": "Consulting",
      "app_amount": 10,
      "app_item_price_net": 150.00,
      "app_vat_percentage": 19,
      "app_unit": "Hours"
    }
  ]
}

Explanation:

  • The invoice data is passed via the JSONata transformation in the service task's input parameter.
  • The HTML template is maintained directly in the process designer using the integrated template editor.
  • The filename is defined in the service task's "PDF filename" field (e.g. Invoice-$(app_invoice_no).pdf).

Output

The task returns a file reference to the generated PDF document.

{
  "referenceId": "01JXXXXX",
  "filename": "Invoice-INV-2026-001.pdf",
  "contentType": "application/pdf"
}

JSONata example

{
  "app_invoice_no": $.app_invoice_no,
  "app_invoice_date": $.app_invoice_date,
  "app_recipient_name": $.app_recipient_name,
  "app_recipient_street": $.app_recipient_street,
  "app_recipient_zip": $.app_recipient_zip,
  "app_recipient_city": $.app_recipient_city,
  "app_invoice_items_custom": $.app_invoice_items_custom
}

Notes

  • Amount calculation is performed automatically before PDF generation — computed fields such as app_net_total or app_vat_total are available in the template.
  • All Handlebars helpers can be used in the template (e.g. currency_eur, toGermanDate, qrCode).
  • This service is ideal when only a PDF is needed — without ZUGFeRD embedding.

Tip

If a ZUGFeRD-compliant e-invoice is also needed, use the Complete e-invoice service instead — it handles calculation, PDF, and ZUGFeRD in a single step.