HtmlToPdf

Convert HTML content to PDFs using Playwright headless Chromium.

1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/mec07/claude_skills --skill htmltopdf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: HtmlToPdf
Source: https://github.com/mec07/claude_skills/tree/main/stow/HtmlToPdf
Command: npx skills add https://github.com/mec07/claude_skills --skill htmltopdf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright.

What problem does it solve?

Converting HTML content to fixed-layout PDFs with high fidelity, eliminating manual conversion and formatting drifts.

Core Features & Use Cases

  • Auto-detects slide decks via data-slide attributes and exports each slide as a separate PDF page.
  • Renders complex layouts, CSS, SVG, and web fonts faithfully using Playwright headless Chromium.
  • Use cases include generating project deliverables, archiving webpages, or converting reports and slides into portable PDFs.

Quick Start

Provide the path to an HTML file and run the skill to generate a PDF alongside the input.

Frequently Asked Questions about HtmlToPdf

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

FAQPage Schema
How do I convert HTML to PDF while preserving CSS, fonts, and layout fidelity?

To convert HTML to PDF with high fidelity, this skill uses Playwright headless Chromium to render complex layouts, CSS, SVG, and web fonts into a fixed-layout PDF, eliminating manual conversion and formatting drifts.

Can I export an HTML slide deck into separate PDF pages automatically?

Yes, you can export HTML slide decks into separate PDF pages. The skill auto-detects slide decks via data-slide attributes and outputs either per-slide PDFs or a single continuous PDF based on your specified flags.

Do I need Playwright installed to automate HTML to PDF conversion?

Yes, you need Playwright installed. The skill requires a Bun or Node runtime environment with Playwright to run headless Chromium for rendering the HTML content and generating the resulting PDF file.

How do I control viewport size when converting a webpage to a PDF document?

You control viewport size during webpage to PDF conversion by passing specific flags. The skill accepts flags for slide or page mode alongside viewport size configurations to ensure the rendered output matches your layout requirements.

What is the best way to automate converting web reports into portable PDFs?

The best way to automate converting web reports into portable PDFs is using a headless Chromium engine. This approach faithfully renders HTML reports and slides into portable PDFs without manual formatting adjustments.