slides-to-pdflisted
Install: claude install-skill tammai/tammai-tools
# Slides → PDF
Exports a `workshop-slides` HTML deck to a single PDF, one page per slide.
The deck is an interactive single-page app: every `.slide` sits at `position: absolute; inset: 0` with `opacity: 0`, and only the `.active` slide is visible. Opening it in a print dialog therefore yields **one** page showing **one** slide. This skill works around that by driving the browser once per slide.
## How it works
1. Headless Chromium loads the deck (`file://` URL) at a 1280×720 viewport, `deviceScaleFactor: 2`.
2. Print-media emulation is switched **off** (`emulateMedia({ media: 'screen' })`) — the deck only ever styles the screen, so emulating `print` would strip its look.
3. An override stylesheet is injected: `@page { size: 1280px 720px; margin: 0 }`, `print-color-adjust: exact`, interactive chrome hidden, and `.slide` display forced off except for one tagged target.
4. For each slide: tag it, call `page.pdf({ printBackground: true, preferCSSPageSize: true })`, keep the bytes.
5. `pypdf` merges the one-page PDFs into one document, adding a bookmark per slide from its `.slide-title`.
## Output geometry
| Property | Value |
|---|---|
| Page size | 1280 × 720 px → **960 × 540 pt** → 13.333 × 7.5 in |
| Aspect ratio | 16:9 (identical to PowerPoint/Keynote widescreen) |
| Device scale | 2× (set, but see below) |
| Text | Vector, selectable and searchable |
**On "retina 2×" — the PDF is better than 2×, and not because of the device scale.** Print-to-PDF output is resolution-