home / skills / aviz85 / claude-skills-library / html-to-pdf
This skill converts HTML to PDF with pixel-perfect rendering and Hebrew/RTL support, ensuring accurate layouts and font handling for web content.
npx playbooks add skill aviz85/claude-skills-library --skill html-to-pdfReview the files below or copy the command above to add this skill to your agents.
No content availableThis skill converts HTML and web pages to pixel-perfect PDFs using a headless Chrome renderer with strong Hebrew and RTL language support. It preserves CSS3/HTML5 fidelity, executes JavaScript, loads web fonts, and auto-detects or forces RTL direction for accurate Hebrew/Arabic output. It is optimized for single-page exports and fine-grained print control.
The converter launches Puppeteer (headless Chrome) to render the HTML exactly as a browser would, waits for network and font readiness, then prints to PDF using CSS @page rules and device scaling for crisp output. It supports loading custom fonts, background graphics, header/footer templates, and command-line options for format, margins, scale, orientation, and RTL handling. Automatic RTL detection or an explicit --rtl flag ensures correct direction and alignment for Hebrew and other RTL content.
How do I avoid extra blank pages in the PDF?
Put backgrounds on a container element rather than html/body, set explicit page dimensions and margins in CSS, and use overflow: hidden to prevent content overflow. You can also reduce scale (--scale) or margins if content still overflows.
My Hebrew text renders left-to-right. How can I fix that?
Add dir="rtl" to your html element, include direction: rtl; text-align: right; in CSS, or use the --rtl flag to force RTL rendering. Ensure you use a Hebrew-capable font and allow extra wait time for fonts to load.