html-to-pdf — Claude Code skill: what it does, how to install
Renders HTML files, URLs, and piped markup into PDF documents using headless Chrome with built-in right-to-left language handling.
npx skills add aviz85/claude-skills-library --skill html-to-pdf -a claude-codeWhat html-to-pdf does
This skill runs a Node.js script via Puppeteer to render HTML assets as PDFs. Because Chromium handles the rendering, flexbox, CSS grid layouts, web fonts, and client-side JavaScript appear exactly as intended. The tool identifies Hebrew or Arabic text on its own, though passing --rtl forces the direction when needed.
An auto-fit mechanism resolves page overflow issues. When content spills by up to ~18%, font sizes shrink automatically to preserve a single-page layout. Larger materials flow cleanly across sheets without splitting table rows or headers. For page count checks, the script invokes pdfinfo from poppler-utils. The check skips silently if that package is absent.
Applying backgrounds to html or body elements produces unintended extra pages. Place backgrounds inside an inner wrapper instead. You must run npm install inside the skill directory before executing your first conversion.
What it helps with
- render local HTML templates directly into PDF files
- export web URLs into print-ready A4 or Letter documents
- format Hebrew or Arabic documents with correct RTL alignment
- pipe raw HTML code from terminal streams directly into PDFs
Example prompts for the agent
- Convert my local invoice.html into a PDF file using Letter format
- Download https://example.com and save it as a landscape PDF
- Render hebrew-doc.html into a PDF file with forced RTL layout
How to install html-to-pdf
1Skills CLI (Vercel)
npx skills add aviz85/claude-skills-library --skill html-to-pdf -a claude-code2Manually: put the files in place
~/.claude/skills/html-to-pdf/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/html-to-pdf/
1Skills CLI (Vercel)
npx skills add aviz85/claude-skills-library --skill html-to-pdf -a codex2Manually: put the files in place
.agents/skills/html-to-pdf/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aviz85/claude-skills-library --skill html-to-pdf -a cursor2Manually: put the files in place
.cursor/skills/html-to-pdf/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aviz85/claude-skills-library html-to-pdf2Manually: put the files in place
.github/skills/html-to-pdf/SKILL.md1Skills CLI (Vercel)
npx skills add aviz85/claude-skills-library --skill html-to-pdf -a gemini-cli2Platform CLI
gemini skills install https://github.com/aviz85/claude-skills-library --path skills/html-to-pdfManually: put the files in place
.devin/skills/html-to-pdf/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aviz85/claude-skills-library --skill html-to-pdf -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about html-to-pdf
How to install html-to-pdf in Claude Code?
Run npx skills add aviz85/claude-skills-library --skill html-to-pdf -a claude-code. Next, navigate to cd ~/.claude/skills/html-to-pdf and run npm install to finish setup.
What does the html-to-pdf skill do?
It compiles HTML documents, piped code, and live web URLs into PDFs through headless Chrome. It ensures reliable font rendering and handles right-to-left text directions.
Why does the exported PDF produce an extra blank page?
Chromium often overflows when background styles sit directly on html or body. Move background definitions to a container element and ensure margins do not push content downward.