Print Templates
Print templates turn a record and its line items into branded HTML that the browser prints or saves as a PDF — invoices, quotes, delivery notes, work orders. Templates are written in Liquid, ship inside modules, and can also be authored by tenant developers in the in-app editor with a live preview.
Printing a record
From a record, choose a print template and dForge renders it to HTML, then hands it to the browser to print or save as PDF. Before rendering, the platform prepares the record so the template stays simple:
- References are resolved — a
customerreference renders the customer’s display name, not its id. - Formula columns are evaluated against the record’s current values.
- Coded fields show their labels — a status of
"P"renders as"Partially Paid", with the raw code still available when you need it. - Line items are loaded for any child set the template actually iterates over.
- Module settings (company name, logo, address) are resolved through the folder chain.
The template context
Every column on the entity is available as a top-level variable, already showing the same value as the form:
{{ invoice_number }} {# raw value #}
{{ status }} {# resolved label, e.g. "Partially Paid" #}
{{ customer }} {# reference → the target row's display value #}
A few helpers give you the other representations of each field:
| Accessor | Gives you |
|---|---|
_fmt.<column> | A locale-aware, display-formatted string — currency, dates, numbers, “Yes/No”, user names. Matches what the form shows. |
_raw.<column> | The underlying code or id (e.g. paid) — use it for CSS classes and {% if %} logic. |
_color.<column> | The hex color of a dropdown option, so a printed badge can match the form’s tint. |
_settings.<name> | Module settings resolved for the folder; image/file settings come through as data URIs ready for <img src>. |
_today | The current date (use _fmt._today for the pre-formatted version). |
Use _fmt.<column> for display, and the bare {{ column }} for arithmetic and comparisons so they run on the typed value.
Line items
Child sets are arrays — iterate them, and use _fmt / _raw on each line:
{% for line in lines %}
<tr>
<td>{{ line.description }}</td>
<td>{{ line._fmt.unit_price }}</td>
<td>{{ line._fmt.line_total }}</td>
</tr>
{% endfor %}
The platform only loads the sets a template actually references in a {% for %}, so templates stay fast.
Company branding
{% if _settings.company_logo %}
<img src="{{ _settings.company_logo }}" alt="{{ _settings.company_name }}" />
{% endif %}
<p>{{ _settings.company_address }}</p>
Filters
On top of the standard Liquid filters, dForge adds locale-aware formatters:
{{ amount_due | format_currency: 'USD' }} {# "$1,234.56" #}
{{ quantity | format_number: 0 }} {# "1,234" #}
{{ invoice_date | format_date: '%B %d, %Y' }} {# "May 22, 2026" #}
A qr_code filter turns a string into an inline QR image — handy for payment slips, asset tags, or links back to the record:
{{ payment_reference | qr_code: 120 }} {# 120px QR code #}
Authoring
Templates can ship pre-built inside a module, or you can write your own in the in-app editor. The editor previews with the same Liquid engine used for the final print, so what you see while editing matches what comes out. Shared markup can be factored into snippets and pulled in with {% include %}.
Related
- Reports & Queries — for on-screen analytics and exports
- Fields Reference — field types, options, and colors that templates read
- Formulas — computed columns available in the template context