Skip to content

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.

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.

For automation, CI pipelines, or batch processing, use the command line:

Terminal window
npm run pdf -- slides.md

This outputs slides.pdf in the same directory. To specify an output path:

Terminal window
npm run pdf -- slides.md output/my-talk.pdf
FlagDefaultDescription
--scale <n>2DPI scale factor. 1 = 72 dpi (smaller files), 2 = 144 dpi (good for print), 3 = 216 dpi
--theme <name>deck defaultOverride theme (e.g. nordic, ostrich, fira)
--scheme <n>deck defaultOverride color scheme number
--autoflowoffEnable autoflow layout inference
--port <n>3032HTTP server port (auto-starts if needed)

Example with options:

Terminal window
npm run pdf -- --theme ostrich --autoflow presentations/my-talk.md
npm run pdf -- --scale 3 slides.md ~/Desktop/high-dpi.pdf

Run 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.

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 2 produces 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 1 to 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.