Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aviz85/claude-skills-library --skill html-to-pdf -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/html-to-pdf/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/html-to-pdf/

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.

Similar skills

Everything for Writing and docs →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor