← ClaudeAtlas

slides-to-pdflisted

Converts an HTML slide deck (produced by the workshop-slides skill) into a single multi-page PDF — one page per slide, at 1280×720 (16:9), with backgrounds, gradients, Google Fonts, and accent colors preserved exactly as they appear on screen. Renders each slide through headless Chromium's print-to-PDF via Playwright, then merges the pages with pypdf. Use this skill whenever the user wants to export, convert, download, print, or share a slide deck as a PDF. Triggers on phrases like "convert my slides to PDF", "export the deck as PDF", "turn this HTML deck into a PDF", "make a PDF of the slides", "print the deck", "I need a PDF version", "slides to pdf". Also trigger proactively right after generating a deck with workshop-slides if the user mentions emailing, uploading, printing, or handing out the slides.
tammai/tammai-tools · ★ 0 · Data & Documents · score 60
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-