deck-to-pdf
Skill1 starsChanged 7 months agoMITView on GitHub
Export an HTML deck, slide page, or long web page to a faithful PDF by screenshotting each section with a real headless browser and stitching the frames into a one-slide-per-page PDF. Use this whenever a user wants a PDF of an HTML presentation/deck/slides/report and the page's own "Print to PDF" / @media print output is broken — wrong pagination, half-empty pages, missing video frames, or lost animated/interactive state. Especially for scroll-snap section decks, video-heavy pages, and canvas/JS-driven visuals.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- shreyas-s-rao/vislidetheir own version, first seen Aug 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- shreyas-s-rao/vislide★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- codex-imagegenSkill
- dashscope-videogenSkill
- svg-animationsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Not for: ordinary document → PDF where print CSS is fine (use the browser's own print), or generating Word/Excel.
- Very specific: line 33
Run this once. If a run later errors with Could not load "playwright", run setup again.
- Very specific: line 68
If a slide's video or entrance animation hasn't finished when captured, raise --wait (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
deck-to-pdf
Turn an HTML page into a PDF that looks exactly like the browser, by capturing it rather than re-flowing it through print CSS.
Why this exists
@media print (and Chrome's "Save as PDF") re-lays-out the page for paper. For decks and rich pages that routinely produces: sections split across pages, big empty gaps from flex centering, <video> rendered as blank boxes, and scroll-triggered / canvas / hover state missing entirely.
This skill sidesteps all of that: it drives headless Chromium, scrolls to each full-viewport slide, lets animations and autoplaying videos settle, takes a retina screenshot, then assembles the screenshots into a clean one-slide-per-page PDF. The PDF is a faithful frame-for-frame capture of what you'd see on screen — video frames and all.
When to use it
- User says the HTML deck's PDF / print export looks wrong (pagination, empty pages, black video boxes).
- You built an HTML deck / slides / presentation and need a sendable, printable PDF companion.
- A video-heavy or canvas / JS-animated page needs a static PDF that still shows the visuals.
- A long scroll page needs to be sliced into PDF pages (
--full-page).
Not for: ordinary document → PDF where print CSS is fine (use the browser's own print), or generating Word/Excel.
One-time setup
The helper needs Playwright + Chromium installed into this skill's directory (so the script resolves playwright from any working directory):
bash ~/.claude/skills/deck-to-pdf/scripts/setup.shRun this once. If a run later errors with Could not load "playwright", run setup again.
Usage
Always run --help first — treat the script as a black box; don't read its source unless you must customize beyond the flags.
node ~/.claude/skills/deck-to-pdf/scripts/deck_to_pdf.mjs --helpTypical run (one PDF next to the HTML):
node ~/.claude/skills/deck-to-pdf/scripts/deck_to_pdf.mjs --html /path/to/deck.htmlKey flags (see --help for all):
| flag | purpose | default |
--html <path> | input HTML (required) | — |
--out <path> | output PDF | <html>.pdf |
--selector <css> | what counts as one slide | section |
--full-page | slice a long page by viewport height instead of by selector | off |
--width / --height | viewport (slide aspect ratio) | 1600 / 1000 |
--scale <n> | retina factor — crispness vs. file size | 2 |
--wait <ms> | settle time per slide (raise if videos/animations need longer) | 1500 |
--hide <css,css> | overlay selectors to strip (nav dots, hints, progress bars) | #dots,.hint,#progress |
--keep-frames | also keep the PNG frames | off |
How to apply
- Identify the slide unit. Full-screen
scroll-snapdecks use<section>(the default). Other decks may use.slide,.page,[data-slide]— pass it via--selector. Long single-flow pages with no slide unit →--full-page. - Match the aspect ratio to the deck's design (16:10 →
1600×1000, 16:9 →1920×1080). - Hide on-screen chrome that shouldn't print — nav dots, keyboard hints, scroll-progress bars — via
--hide(the default already covers the common#dots,.hint,#progress). - If a slide's video or entrance animation hasn't finished when captured, raise
--wait(e.g.2500). - Report the output path and page count to the user. Mention retina PDFs can be large; suggest
--scale 1if they need a smaller file.
Notes & limits
- Designed for one-slide-per-viewport decks. A section taller than the viewport gets cropped to the viewport — for such pages use
--full-page, or make each section fit the viewport. - Videos are captured as whatever frame is showing when the shot fires; it does not embed playable video.
- Output pages are sized to the viewport (
--width × --height); margins are zero so the capture fills the page edge-to-edge. - The script also handles assembly internally (via Chromium's
page.pdfover the captured frames) — nopoppler/ffmpeg/ImageMagick needed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

