PDF Export
StellarDeck exports to PDF entirely offline. Two ways to do it: click a button in the toolbar, or run a CLI command for automation.
UI Export
Section titled “UI Export”In the StellarDeck app (browser or desktop), click the PDF export button in the toolbar. A progress overlay shows slide-by-slide capture. When done, the PDF downloads automatically.
The export takes roughly 10-15 seconds for a typical deck. The toolbar and sidebar stay visible during export — only the slide area shows the progress overlay.
CLI Export
Section titled “CLI Export”For automation, CI pipelines, or batch processing, use the command line:
npm run pdf -- slides.mdThis outputs slides.pdf in the same directory. To specify an output path:
npm run pdf -- slides.md output/my-talk.pdfOptions
Section titled “Options”| Flag | Default | Description |
|---|---|---|
--scale <n> | 2 | DPI scale factor. 1 = 72 dpi (smaller files), 2 = 144 dpi (good for print), 3 = 216 dpi |
--theme <name> | deck default | Override theme (e.g. nordic, ostrich, fira) |
--scheme <n> | deck default | Override color scheme number |
--autoflow | off | Enable autoflow layout inference |
--port <n> | 3032 | HTTP server port (auto-starts if needed) |
Example with options:
npm run pdf -- --theme ostrich --autoflow presentations/my-talk.mdnpm run pdf -- --scale 3 slides.md ~/Desktop/high-dpi.pdfRun npm run pdf -- --help for the full reference, or see the Command Line guide for all formats (PDF, PNG, grid), slide range selection, JSON output, and stdin input.
How It Works
Section titled “How It Works”Each slide is captured as a PNG using html2canvas, then composed into a multi-page PDF via pdf-lib. The same export code runs in both the UI (inside the browser/WKWebView) and the CLI (inside headless Chromium via Playwright). Dependencies are loaded from CDN on first use — no local install needed.
- Print quality: the default
--scale 2produces 144 dpi PDFs — good enough for most print scenarios. - File size: a 30-slide deck at scale 2 is typically 5-15 MB depending on image content. Use
--scale 1to cut size roughly in half. - Offline: the export runs entirely in the browser. No files are uploaded to external services.
- Fonts: export uses the same fonts as the slide engine. If a theme font hasn’t loaded yet, the export waits for
document.fonts.ready. - PDFs are gitignored in the presentations repo — they’re regenerable from markdown at any time.