Skip to content

Standard Template Concepts

A standard template produces its PDF with the JustOn PDF service. The document structure and layout are defined by a Liquid file attached to the template record, written in the Liquid template language. The template record supplies the texts, the formatting settings and the email contents.

For information on the difference to classic templates and a feature comparison, see Working With Templates.

Related information:
Configuring Standard Templates
Working With Liquid Code
Configuring Template Details

Document Model

With standard templates, structure and styling live in the Liquid file, whereas texts and some metadata come from in the template record:

  • Structure – which tables exist, their columns and rows, sections, subtotals, page layout, and the page counter – is defined by the Liquid file, which iterates over the invoice data and lays everything out itself.
  • Styling is defined by the Liquid file (its markup and CSS), plus the optional Custom CSS field.
  • Only text – localized labels and free-text blocks – along with locale/format settings and a few feature gates are mapped from the template record.

Practical consequence: to change the invoice layout, tables, columns or look, you edit the Liquid file, not the template record's structure fields. Template fields that drive the classic (Visualforce) PDF have no effect here – they are hidden on the template record.

For a field-by-field overview of which Template fields are read when creating the PDF and which are ignored, see Standard Template Field Usage.

PDF/A Output

Every standard template PDF is a PDF/A-3B document (ISO 19005-3), produced automatically with no extra configuration. This means:

  • the document is self-contained – all fonts are embedded,
  • it declares an sRGB output intent, and
  • it carries PDF/A identification metadata.

PDF/A is an ISO-standardized format for the long-term archiving of electronic documents, which makes the output suitable for compliant long-term storage.

PDF/A-3 is also the mandatory container for ZUGFeRD/Factur-X hybrid e-invoices. A ZUGFeRD e-invoice therefore requires a standard template – this is a hard prerequisite.

How the PDF relates to ZUGFeRD

For ZUGFeRD e-invoices, JustOn Billing & Invoice Management first renders the PDF/A-3 document, then embeds the EN 16931 invoice XML to form the final ZUGFeRD file.

The PDF service renders the PDF/A container – it does not itself create the embedded XML. Building and embedding the Cross-Industry-Invoice (CII) XML is handled by the JustOn e-invoice creation, not by the PDF renderer. For details, see Configuring ZUGFeRD E-Invoices.

Language Variants

Localization does not happen in the Liquid file. All language variants share the same file. What differs is the template record, which carries the language, the locale and the translated labels.

Field Role
Language The document language.
PDF Options The locale, for example {"locale":"de"}.
Overrides The translated labels without a dedicated field, as a JSON map under the v3 key.
Label fields Subtotal, tax and discount labels as well as the tax-table and outstanding-invoices intro texts.
Free-text blocks Greeting, closing, footer and payment instructions.
Format fields Date format, decimal and grouping separator.

Creating a template through the New button on the Templates tab and selecting a language populates all of these for you. For the complete set of values, see Language-Specific Values.

Note

The email texts are not localized – Email Subject and Email Body carry the English default in every language. Translate them yourself after creating the template.

One Liquid file covers one kind of document: Invoice Template covers invoices, credits, cancellations, pro forma and deposit invoices.

Info

Everything else about diversifying templates – multiple template records per target, and template details for email texts and counters – works the same way as for classic templates. For details, see Template Variation.

PDF Renderer Versions

JustOn Billing & Invoice Management selects the PDF rendering approach per template, using the PDF Renderer field on the template record:

PDF Renderer Mechanism Engine Output
v3 Standard template JustOn PDF service (OpenHTMLtoPDF) PDF/A-3B
empty Classic template Salesforce Visualforce PDF rendering Standard PDF
v2 Liquid file, earlier engine JustOn PDF service (Chromium) Standard PDF

Templates created through the New button use v3.

The earlier v2 engine remains available for specific use cases that have not been ported yet, most notably Swiss QR-bill invoices as well as dunning reminders and account statements.

Info

v2 and v3 use the same Liquid files, but render some CSS and fonts differently. For further information, see Migrating Templates From v2 to v3.

Limitations

Be aware of the following restrictions:

  • No external resources will be loaded (like image URLs).
  • To embed assets (images, fonts etc.), you have to use data URIs. The assets must be encoded as base64 strings. For details, see Embedding Assets.
  • By default, backgrounds are not rendered. To control this behavior, use specific CSS styles per element:

    -webkit-print-color-adjust: exact;
    
  • No scripts can be run.

  • The following tags are allowed: a, abbr, acronym, address, area, article, aside, b, base, basefont, bdi, bdo, big, blockquote, body, br, button, canvas, caption, center, cite, code, col, colgroup, data, datalist, dd, del, details, dfn, dialog, dir, div, dl, dt, em, fieldset, figcaption, figure, font, footer, form, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, img, input, ins, kbd, label, legend, li, link, main, map, mark, meta, meter, nav, noframes, noscript, ol, optgroup, option, output, p, param, picture, pre, progress, q, rp, rt, ruby, s, samp, section, select, small, source, span, strike, strong, style, sub, summary, sup, svg, table, tbody, td, template, textarea, tfoot, th, thead, time, title, tr, track, tt, u, ul, var, wbr.
  • Consequently, the following tags are not allowed: applet, audio, embed, frame, frameset, iframe, object, script, video.

The rendering engine adds further CSS and font restrictions:

Aspect Restriction
CSS support CSS 2.1 + print extensions; no Flexbox, Grid, calc(), custom properties (var()), transitions/animations, or @media queries other than @media print
Default fonts Built-in Noto families (Noto Sans, Noto Serif, Noto Sans Mono, with symbol/emoji/math fallback)
Font embedding @font-face with TTF only (static TrueType; variable fonts not supported)
Page header/footer Defined in the Liquid file via @page margin boxes and page counters, not in the Page Header/Footer template fields

On the other hand, several print-oriented features are supported, including @page rules (size, orientation, margins), page-break-*, page numbering via counter(page)/counter(pages), repeating table headers (<thead>), footnotes (float: footnote), inline SVG, CSS transforms, border-radius, box-sizing, and right-to-left/bidirectional text.

Template Variation and Data Origin

JustOn Billing & Invoice Management attaches a default Liquid file to standard templates for invoices (including progress, partial, pro forma and deposit invoices), credits and cancellations. For dunning reminders and account statements as well as for Swiss QR-code invoices, there are Liquid files that work with the rendering engine v2.

In the simplest approach (no locale-specific variation, etc.), you have one template record to which is attached the corresponding Liquid file, as well as are associated the template detail records to cover your use cases. Now depending on the use case, JustOn Billing & Invoice Management uses the template record, the Liquid file attachment or the associated template detail to produce the PDF file and the email.

template_v2_process
Example use cases

Your business may, however, need to cover more complex scenarios, like multiple locales, different customer groups, etc. In this case, you duplicate this structure: You create a second (third, etc.) template record intended for the specific purpose, and attach the corresponding specific Liquid template files and associate the relevant template detail records.

Use Case Data Category Data Origin
Invoice PDF layout and standard texts Invoice Liquid template (v3)
Email standard texts Template record
Counter Template record
Credit PDF layout and standard texts Invoice Liquid template (v3)
Email standard texts Credit template detail record
Counter
Optionally, if different from invoice counter
Credit template detail record
Cancellation PDF layout and standard texts Invoice Liquid template (v3)
Email standard texts Cancellation template detail record
Counter
Optionally, if different from invoice counter
Cancellation template detail record
Dunning reminder PDF layout and standard texts Dunning Liquid template (v2)
Email standard texts Dunning template detail record
Counter Dunning template detail record
Account statement PDF layout and standard texts Account statement Liquid template (v2)
Email standard texts Account statement template detail record
Counter Account statement template detail record

Email Contents

In addition to the fields that are printed to the PDF, the invoice template also includes texts for the email that JustOn can send to distribute the produced invoice files (see Emailing Invoices). These fields include:

Template Section Field Description
Email Text PDF Name Specifies the name for the generated PDF file. It can contain placeholders, the default is [InvoiceDate]_[InvoiceNo]_[AccountName].pdf. The allowed characters include the alphanumeric characters a-z A-Z 0-9 as well as the underscore _ and hyphen - characters.
Attach Files To Outgoing Email (checkbox) Controls whether attached files are included in any outgoing email.
Email File Types Defines the mandatory file types to be attached to invoice emails (comma separated list of content version types, like, for example, Invoice PDF, E-Invoice).
If empty, defaults to Invoice PDF.
Transaction Table HTML and E-Invoice Validation Report will always be excluded from being attached.
Email Sender Defines an email sender address, must be available as an organization-wide email address.
Takes precedence over the email sender address set on the business entity.
Email Subject Defines the default email subject. Can include placeholders, like Invoice: [InvoiceNo] (default).
Email Body Defines the plain text (or HTML source code) body for the email. Can include placeholders, and line breaks are considered.
Email HTML Body Defines a rich HTML body text for the email. The editing area of this field includes an inline HTML editor.
Must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the field Email Body.

Note

Be aware of the following specifics:

  • Email Body is ignored if there is content in Email HTML Body.
  • You must use either Email Body or Email HTML Body in both the template and its associated template details.
  • Email HTML Body must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the field Email Body.