Preview letter layout
preview_letterRenders a letter in memory to verify layout before printing, returning metrics and warnings that show whether the address fits the field or the letter spills onto a second page.
Instructions
Renders the letter in memory and returns layout metrics and warnings without writing a file. Use it to check whether the address fits the address field or the letter runs onto a second page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Letter text. Blank lines separate paragraphs, "- " starts a bullet list, "1. " a numbered list, **bold** and *italic* are supported, "\pagebreak" forces a page break. | |
| date | No | ISO date (2026-07-24), "today" or free text. Default "today". | |
| marks | No | Remark zone above the address, max. 3 lines, e.g. ["Einschreiben"]. | |
| place | No | Place for the "place, date" line. | |
| copyTo | No | ||
| locale | No | Language of the fixed texts and date format. Supported: de, en, fr, es, it, nl, pt, pl, tr, da, sv, cs. Regional tags such as "en-US" are accepted. Default "de". | |
| sender | No | Sender, printed as the small return address line above the recipient. Only needed when no profile is used, a profile always wins. | |
| closing | No | Default is the closing phrase of the locale. | |
| profile | No | Sender identity, taken from the profile file on this machine (see list_profiles). The profile provides address, return address line and signature image. Use this instead of typing a sender. | |
| subject | No | Subject line, printed without a "Betreff:" label as required by DIN 5008. | |
| metadata | No | ||
| dateStyle | No | Default "numeric" (24.07.2026). | |
| recipient | Yes | Recipient, positioned in the DIN 5008 address field so it shows in the envelope window. | |
| signature | No | Signature below the closing line. The image is scaled and placed by the renderer: it is laid over the blank line above the printed name and deliberately overlaps the closing line, exactly like a signature on paper. That overlap is intended and must not be compensated for. | |
| enclosures | No | ||
| salutation | No | Default is the generic salutation of the locale. | |
| subjectLines | No | Further bold lines right below the subject. This is where a normal German letter carries references, e.g. ["Zeichen: 535 B 335D028418", "Kunden-Nummer: 335D028418"]. | |
| countryDisplay | No | When to print the country line, default "auto" (only for foreign recipients). | |
| returnAddressLine | No | Return address line above the recipient. Generated from the sender, pass "" to hide it. |