Create letter PDF
create_letterRenders a letter into a print-ready PDF with DIN 5008 address field, 25 mm writing margin, fold and punch marks, bold subject. Returns file path, page count, and layout metrics.
Instructions
Renders a letter as a PDF file in the fixed house layout (DIN 5008 address field, 25 mm writing margin, fold and punch marks, bold subject block). Pass content only, the layout is fixed. The signature image intentionally overlaps the closing line. Returns the absolute file path, the page count, layout metrics and warnings.
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). | |
| overwrite | No | Overwrite an existing file instead of adding a counter, default false. | |
| 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 | ||
| outputPath | No | Target PDF path. Default: PDF_LETTER_OUTPUT_DIR (or the temp directory) plus a name derived from the subject. | |
| salutation | No | Default is the generic salutation of the locale. | |
| returnBase64 | No | Also return the PDF as base64, default false. | |
| 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. |