Print formats
Print a Record or save it as a PDF, with your own layout and letter head.
Open a Record and choose Print from the form menu. The print view at /desk/print/<rectype>/<name> has selectors for Print Format, Letter Head and Language. PDF downloads the page as <name>.pdf.
Printing needs the print right on the Record. Drafts print unless Print Settings turns off Allow Print for Draft.
Print formats
Without a Print Format, Cardinal prints the form's fields in its layout. A Print Format changes that.
| Field | Use |
|---|---|
| Print Format For | RecType or Report |
| RecType | The RecType it prints, such as Sales Invoice |
| Custom Format | Tick to write your own HTML |
| HTML | A Jinja template |
| CSS | Added to the page's style |
| Margins | Top, Bottom, Left and Right in mm, 15 by default |
| Default Print Language | The language it prints in unless the user picks another |
Without Custom Format, you get options for the standard layout: Align Labels to the Right, Show Section Headings and Show Line Breaks after Sections.
<h2>{{ doc.name }}</h2>
<p>Customer: {{ doc.customer_name }}</p>
<table>
{% for row in doc.items %}
<tr><td>{{ row.item_name }}</td><td>{{ row.qty }}</td><td>{{ row.amount }}</td></tr>
{% endfor %}
</table>
<p>Total: {{ doc.grand_total }}</p>The template gets doc, letter_head, print_settings and no_letterhead. A report's format gets data, columns, filters, rows and total. Each render runs in a separate sandbox process capped at 64 MB and 2 s of CPU.
Letter heads
A Letter Head adds a header and footer to every page.
| Field | Options |
|---|---|
| Header Based On | Image or HTML |
| Footer Based On | Image or HTML |
| Header Height (mm) | 30 by default |
| Footer Height (mm) | 15 by default |
| Default Letter Head | Used for every print unless the user picks another |
With Print Settings' Repeat Header and Footer on, each PDF page repeats them and the footer shows page numbers.
PDFs
PDFs render through a Gotenberg service with JavaScript off and no network access. Images from /api/file/... that the user may download are embedded in the page. Each PDF download writes an Access Log row.
Print Settings
/desk/print-settings holds the site-wide options.
| Field | Default | Effect |
|---|---|---|
| PDF Page Size | A4 | A0 to Tabloid, or Custom with PDF Page Width and Height in mm |
| Repeat Header and Footer | on | Letter head and page numbers on every PDF page |
| Print with Letter Head | on | Use the default Letter Head |
| Allow Print for Draft | on | Drafts can print |
| Always Add "Draft" Heading for Printing Draft Records | on | A DRAFT banner on draft prints |
| Allow Print for Cancelled | off | Cancelled Records can print, with a CANCELLED banner |
| Max Bulk Print Records | 100 | Most Records one combined PDF may hold |
Print headings
A Print Heading replaces the RecType name at the top of a print. Create one such as Tax Invoice, then pick it in the Print Heading field that ERP vouchers such as Delivery Note have.