Repository navigation
PDF Engine (MVP)
github-actions[bot] edited this page Nov 7, 2026
·
3 revisions
Developer notes for the minimal, reliable PDF exporter (the app's only PDF engine).
- Code:
src/utils/pdf_mvp/(browser entryindex.js, layout inpure.js) - Entry:
downloadSingleSongPdf(song),downloadMultiSongPdf(songs),downloadSongbookPdf(songs, opts), andplanSingleSong(song)
- 1‑column, single page at sizes 16 → 12 pt
- 2‑column, single page at sizes 16 → 12 pt
- Fallback: 1‑column multipage at 15 pt (title/key header only on page 1)
- Title: 26 pt, bold; wraps as needed
- Key: 16 pt, italic gray (
rgb(90,90,90)), tight under title - Lyrics: 12–16 pt, line‑height ≈ 1.2×
- Section headers: same size as lyrics (bold), rendered as
[LABEL] - Header gap: ≈ 1.125× lyric line‑height before first section
- Drawn on their own line above the wrapped lyric line
- Align above the exact lyric characters they precede
- Enforce ≥ one space width between successive chords; nudge minimally
- Trailing chords flush to end‑of‑line with a single‑space separation
- Page margins: 0.5" on all sides
- Two columns use a 24 pt gutter and equal widths
- Sections are atomic and never split across columns/pages
- Preferred: Noto Sans (Regular/Italic/Bold) and Noto Sans Mono (Regular/Bold)
- Place font files under
apps/web/src/assets/fonts/(imported with?urland registered at runtime) - Falls back to jsPDF built‑ins (
helvetica/courier) if Noto is unavailable
- Run:
npm run test:mvp - Suites:
src/__tests__/pdf_mvp.*.test.js(plan,chords,sections,pure,songbook)
- Title 26 pt; Key 16 pt gray; lyric/chord 12–16 pt; line‑height ≈ 1.2×
- Minimal 1‑space chord separation; chords align over matching lyric characters
- Sections never split; header gap ≈ 1.125× lyric line
See also PDF-and-Printing.
-
User Guide
-
Editing & Admin
-
Developer Guide
-
Infrastructure
-
Mobile