PDF Letterhead
A PDF layout with its own look, a letter with an address frame, and the transfer of the layout to templates.
What it shows
Section titled “What it shows”- A system
pdf-layoutwith a header, a footer in three columns (a borderless table) that prints the company placeholderscompanyAddress,companyIbanandcompanyBic, and appearance inmeta: font, size, table style and page margins in mm. - A
document-pdfletter with an address frame (data-frame, presetaddress) at the DIN 5008 form B window position, and a text style (data-text-style) on a run of text. - Company placeholders read the tenant’s own settings (
tenant:config:company-*); the validate query lists the ones a tenant has left empty. apply-layouthands the layout to chosen templates as drafts (modeselected) or makes it the tenant default (modeall, no copies);publish-templatesactivates the drafts together; the usage query lists which templates use the layout.
Source
Section titled “Source”src/letterhead.ts holds the layout, the letter and the tenant-editable list; the app passes the list to createTemplateResolverFeature({ tenantEditable }).
Needs the Postgres from the repo root’s docker-compose.yml (docker compose up -d); TEST_DATABASE_URL defaults to postgresql://kumiko:kumiko@localhost:15432/kumiko_test.
cd samples/recipes/pdf-letterheadbun testSource
Section titled “Source”📄 On GitHub: samples/recipes/pdf-letterhead