Johannes Kaindl215 downloadsGenerate professionally formatted business letters (DIN 5008 and modern) from note frontmatter and export them to PDF — via the print dialog on desktop, or the system share sheet on iPhone and iPad.
🇬🇧 English · 🇩🇪 Deutsch
An Obsidian plugin that turns a note into a professionally formatted business letter — German DIN 5008 or a clean modern layout — and exports it to PDF: on desktop via the OS print dialog, on iPhone/iPad as a real, text-selectable PDF shared with one tap.
DIN 5008 (German) · Modern (English) — two layouts, two letter languages.
DIN 5008 (German standard, ready for a window envelope) and Modern (international) — choose in Settings → Layout.sprache frontmatter field.absender/sender or individual fields).isDesktopOnly: false), AGPL-3.0.Repository: github.com/johannes-kaindl/obsidian-letterhead (source mirror: codeberg.org/jkaindl/obsidian-letterhead)
# Copy the plugin into your vault
cp manifest.json main.js styles.css versions.json \
"<your-vault>/.obsidian/plugins/letterhead/"
# …or, with OBSIDIAN_PLUGIN_DIR exported:
npm run deploy
Then: Obsidian → Settings → Community plugins → reload → enable Letterhead → fill in your sender profile.
The note body below the frontmatter is the letter text and is rendered as Markdown.
Everything is configured in Settings → Letterhead; nothing requires CSS. The essentials:
| Group | What you set there |
|---|---|
| Layout & style | DIN 5008 or Modern; one of three styles (matter-of-fact / classic / technical); full info block or plain date line; DIN form A (27 mm) or B (45 mm). |
| Sender profile | Name, addition, street, postcode/city, phone, email, web — plus the return-address line for the envelope window. Every field is overridable per letter in the frontmatter. |
| Elements | Fold marks, hole mark, print offset (shifts the content down if the address sits too high in the window), logo instead of the sender name. |
| Typography & language | Font and font size overrides, date locale, letter language (German or English printed labels — separate from the plugin's UI language), default closing. |
| Advanced | Output target, filename scheme, custom CSS. |
Two settings decide where your PDF ends up and what it is called:
" (2)" is appended instead. Applies to the vector PDF export, not to the desktop print dialog.{notiz} {datum} {datum_lang} {empfaenger} {betreff} {unserzeichen}; anything else in the field is kept literally. {datum} yields YYYY-MM-DD so letters sort chronologically in a file manager, {datum_lang} prints the date as it appears in the letter.Existing installations keep their previous behaviour (share directly, {notiz}); only fresh installations start with the new defaults. Full reference: docs/reference/settings.md.
A letter is an ordinary note. Its frontmatter carries the metadata (recipient, subject, salutation, closing, enclosures, …) and the note body is the letter text, rendered as Markdown. Field names exist as German and English aliases, so subject: and betreff: are the same field.
Export then takes one of two deliberately different routes:
Both routes share the same geometry. DIN 5008 positions — address field, fold marks at 105/210 mm (or 87/192 mm), hole mark at 148.5 mm — are placed as absolute paper coordinates so the recipient address lines up with a window envelope. Print margins are set automatically (page 1: 10 mm top, continuation pages: 25 mm, 20 mm bottom).
Pick a style and info-line mode directly in the settings — no CSS required. For fine-tuning beyond that, the look is driven entirely by CSS custom properties (design tokens): the Custom CSS field (Settings → Advanced) comes pre-filled with a fully commented-out preset — uncomment a line and adjust it; the Reset preset button restores that initial state, or you can copy presets/letterhead-theme.css. Geometry tokens marked DIN-critical keep the address block aligned with the envelope window — change them deliberately. Full token list: docs/reference/theming.md.
TypeScript, bundled to main.js with esbuild. main.js is build output (gitignored, not committed) — install dependencies once, then build and deploy into your vault.
npm install
npm run build # typecheck + esbuild → main.js
npm test # vitest
npm run gate # typecheck + test + check:pure + build
npm run deploy # build, then copy manifest.json main.js styles.css versions.json → $OBSIDIAN_PLUGIN_DIR
See AGENTS.md for the full architecture notes and remaining deliberate deviations from the workspace ts-node · obsidian-plugin profile.
Letterhead runs entirely on your device: no network calls, no telemetry, no tracking. The source is TypeScript in src/, readable and auditable; main.js itself is build output, not a committed file. The only btoa() call embeds your configured logo as an inline data: URL. Releases are cryptographically signed with a Sigstore/SLSA build-provenance attestation, built fresh from the tagged source by GitHub Actions — confirm the main.js you run came from this source with gh attestation verify main.js --repo johannes-kaindl/obsidian-letterhead. Full statement and how to report a vulnerability: SECURITY.md.
Code: AGPL-3.0-or-later — see LICENSE; commercial dual-license option in LICENSING.md.
Documentation/text: CC BY-SA 4.0 — see LICENSE-DOCS.