
Html To Pdf
Converts HTML to PDF using Puppeteer's Chrome engine, which means you get actual browser rendering with full CSS3, custom fonts, and JavaScript execution. The standout feature is automatic RTL detection for Hebrew and Arabic, plus built-in overflow handling that either shrinks content to fit or flows it across pages intelligently. The documentation is unusually thorough about the gotchas: backgrounds on html/body elements cause phantom pages, scaling below 1.0 breaks multi-page layouts in RTL, and there's specific guidance on getting single-page documents to actually stay single-page. Includes a page count checker that warns you when content overflows. If you're generating invoices, reports, or certificates with Hebrew text, this handles the direction and font rendering better than most PDF libraries.
- skills.sh installs
- 1.2K
- GitHub stars
- 51
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aviz85/claude-skills-library --skill html-to-pdf --agent claude-codeInstalls into .claude/skills of the current project.
Files
HTML to PDF Converter
Pixel-perfect HTML to PDF conversion using Puppeteer (Chrome headless). Provides excellent support for Hebrew, Arabic, and other RTL languages with automatic direction detection.
Why Puppeteer?
- Pixel-perfect rendering: Uses actual Chrome engine
- Full CSS3/HTML5 support: Flexbox, Grid, custom fonts, backgrounds
- JavaScript execution: Renders dynamic content
- Automatic RTL detection: Detects Hebrew/Arabic and sets direction
- Web font support: Loads custom fonts properly
Auto-Fit (Built-in, No Flag Needed)
The script automatically handles content overflow:
- Small overflow (up to ~18%) → auto-shrinks font size to fit the page
- Large content → flows cleanly across multiple pages with smart page-break rules (no cutting headers, table rows, or images in half)
- Fits perfectly → does nothing
This runs automatically on every PDF generation. No flags needed.
CRITICAL: Fit Content to Single Page
Backgrounds on html or body cause extra pages! Put backgrounds on a container element instead:
@page { size: A4; margin: 0; }
Sponsors
Details
- Repository
- github.com/aviz85/claude-skills-library
- Categories
- Frontend Development, Office & Documents