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

Installs 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

More from aviz85/claude-skills-library

All 6
1vercel-labs avatarreduxvercel-labs/json-renderRedux adapter for json-render's StateStore interface. Use when integrating json-render with Redux or Redux Toolkit for state management via @json-render/redux.1.1Kskills.sh installs
2patternsdev avatarreact-render-optimizationpatternsdev/skillsTeaches React rendering performance optimization patterns. Use when reducing unnecessary re-renders, optimizing memoization, improving state design, or diagnosi1.1Kskills.sh installs
3spences10 avatarsvelte-runesspences10/svelte-skills-kitSvelte runes guidance. Use for reactive state, props, effects, or migration. Covers $state, $derived, $effect, $props, $bindable. Prevents reactivity mistakes.1.1Kskills.sh installs
4patternsdev avatarreact-data-fetchingpatternsdev/skillsTeaches modern React data fetching patterns with TanStack Query, SWR, and Suspense. Use when implementing caching, deduplication, optimistic updates, or paralle1.1Kskills.sh installs
5astronomer avatarsetting-up-astro-projectastronomer/agentsInitialize and configure Astro/Airflow projects. Use when the user wants to create a new project, set up dependencies, configure connections/variables, or under1.1Kskills.sh installs
6mindrally avatarhtmlmindrally/skillsGuidelines for semantic HTML markup, document structure, forms, accessibility attributes, and modern HTML best practices1.1Kskills.sh installs