html2pdf
Skill8 starsChanged 3 months agoMITView on GitHub
Convert HTML, especially slide-style HTML presentations, into paginated PDF using Chrome or Edge headless printing. Use when the user mentions `html2pdf`, wants to export HTML to PDF, or needs each slide/page in a presentation HTML to become a separate PDF page instead of one long page.
In this repository32 other files it gives its agents.
- ai-genSkill
- any2mdSkill
- assignment-wordSkill
- cheatsheatSkill
- claude2antiSkill
- claude2codexSkill
- codex2claudeSkill
- fincomp-deckSkill
- github-trendingSkill
- git-pushSkill
- html2mdSkill
- html2texSkill
- html-slidesSkill
- img-readerSkill
- latex-beamerSkill
- markitdownSkill
- md2docxSkill
- md2texSkill
- mergeSkill
- notesSkill
- paper-html-onepageSkill
- paper-reproSkill
- pdf2wordSkill
- pdf-readerSkill
- posterSkill
- repo-docsSkill
- repo-docs-zhSkill
- resume-builderSkill
- web-search-fallbackSkill
- word2htmlSkill
- word2mdSkill
- word2pdfSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
If the HTML looks like a presentation, let the script auto-inject print pagination CSS.
- Distinctive: line 39
If available, verify the resulting PDF page count and report the output path.
- Very specific: line 63
If the HTML already has correct @media print pagination rules, the script can still print it directly.
- Distinctive: line 64
Prefer reporting the generated PDF path and page count instead of dumping command output.
≈ “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
html2pdf
Convert local HTML files to PDF with browser-grade rendering.
This skill is designed for two cases:
- ordinary HTML pages that should print to PDF as-is
- presentation-style HTML with fixed-size
.slidepages that need to become multi-page PDF output
Run
From this skill directory, run:
python html2pdf.py <input.html> [output.pdf]What It Does
For presentation HTML, the script can:
- detect slide-style layouts such as
.presentationand.slide - inject print CSS into a temporary copy
- make all slides visible during print
- force each slide to become one PDF page
- hide navigation bars during export
For ordinary HTML, it prints the page directly without altering the source file.
Workflow
- Confirm the input HTML exists.
- Run
html2pdf.py. - If the HTML looks like a presentation, let the script auto-inject print pagination CSS.
- Export with Chrome or Edge headless.
- If available, verify the resulting PDF page count and report the output path.
Examples
# Default output: same basename as input
python html2pdf.py "slides.html"
# Explicit output path
python html2pdf.py "slides.html" "slides_10pages.pdf"Dependencies
Require one of:
- Google Chrome
- Microsoft Edge
Optional:
PyPDF2for PDF page-count verification
Notes
- The script does not overwrite the source HTML. It writes a temporary print-ready copy when needed.
- If the HTML already has correct
@media printpagination rules, the script can still print it directly. - Prefer reporting the generated PDF path and page count instead of dumping command output.
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.

