html-to-pdf

Convert HTML files to PDF or PNG with multi-page and single-page modes.

1|1|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/yonggao/claude-plugins --skill html-to-pdf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: html-to-pdf
Source: https://github.com/yonggao/claude-plugins/tree/main/skills/html-to-pdf
Command: npx skills add https://github.com/yonggao/claude-plugins --skill html-to-pdf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright, Pillow, pypdf.

What problem does it solve?

This Skill eliminates the manual hassle of converting HTML content into professional, shareable PDF or PNG formats. It ensures your web-based reports, dashboards, or documentation are perfectly rendered for printing or presentations, saving you time and ensuring consistent output.

Core Features & Use Cases

  • Multi-Page PDF (A4): Generate standard, print-ready PDFs with proper page breaks and zero margins, ideal for archiving or physical distribution.
  • Single-Page Long Image PDF/PNG: Create seamless, scrollable PDFs or high-quality PNG screenshots without any page breaks, perfect for online presentations or visual sharing.
  • Advanced Rendering: Preserves all CSS styling, gradients, and handles complex elements like lazy-loaded content and animations, ensuring a true-to-source conversion.
  • Use Case: Convert a dynamic HTML business report into a single, elegant PDF for a presentation, or transform a detailed web documentation page into a multi-page PDF for offline review.

Quick Start

Convert an HTML file to a single-page PDF (no page breaks)

python ~/.claude/skills/html-to-pdf/html_to_long_image.py your_report.html

This will generate:

- your_report_fullpage.png (full-page screenshot)

- your_report_fullpage.pdf (single-page PDF from the screenshot)

Frequently Asked Questions about html-to-pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert HTML to PDF with proper formatting?

Convert HTML to PDF by running the html_to_pdf Skill, which renders your HTML file using Playwright and outputs a print-ready PDF with zero margins, preserved CSS styling, and proper page breaks for A4 layouts or single-page long-image formats.

Can I generate a single-page PDF from long HTML content without page breaks?

Yes, the Skill creates single-page long-image PDFs by converting your HTML to a seamless screenshot-based PDF or PNG, eliminating page breaks for presentations and online sharing while preserving all styling and complex elements.

Does this support converting HTML with CSS animations and lazy-loaded content?

The Skill handles advanced rendering including CSS gradients, animations, and lazy-loaded content through Playwright, suppressing animations and waiting for lazy loading to complete for accurate, true-to-source conversion.

What output formats can I generate from HTML files?

Generate both PDF and PNG formats: multi-page A4 PDFs for print-ready reports, or single-page PDFs and PNG screenshots for online viewing, presentations, and visual documentation sharing.

Does the Skill support Chinese and CJK characters in HTML documents?

Yes, the Skill includes built-in Chinese and CJK character support, rendering complex language text accurately in both PDF and PNG outputs without additional configuration.

Can I process multiple HTML files in batch conversion workflows?

The Skill supports both single-file and batch workflows, allowing you to convert multiple HTML documents to PDF or PNG for automated report generation, documentation archiving, or mass presentation creation.