Skip to content

Invoice PDF generation

Starting from yeti-web 1.15.26, invoice PDF documents are generated from HTML Invoice Templates by the yeti-pdf service. It is built on pongo2 (Jinja2/Django-style template engine) and the pure-Go folio HTML rendering engine, so no LibreOffice or headless browser is required.

Installing yeti-pdf

yeti-pdf is available from the Yeti package repositories:

console
# apt install yeti-pdf
# systemctl enable yeti-pdf
# systemctl start yeti-pdf

The service reads its configuration from /opt/yeti-pdf/yeti-pdf.yaml; the options are documented inline in the shipped file.

Connecting yeti-web

Point yeti-web to the service in the invoice section of yeti_web.yml:

yaml
invoice:
  pdf_api:
    base_url: "http://127.0.0.1:9080"
    auth_token: "replace-me-with-a-long-random-secret"
    timeout: 30

When an account's invoice template contains HTML and invoice.pdf_api is configured, invoice documents are rendered through yeti-pdf.

Legacy ODT templates (before 1.15.26)

The deprecated ODT invoice templates are rendered with LibreOffice. If you still use them, install the additional packages:

# apt install unoconv libreoffice-core

Service yeti-libreoffice-headless is disabled by default, you have to enable it.

# systemctl enable yeti-libreoffice-headless

Run it

# systemctl start yeti-libreoffice-headless