HTML to PDF

Convert HTML pages or URLs into PDF documents with Playwright or Puppeteer.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/arturogj92/moltolicism --skill html-to-pdf-arturogj92
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: HTML to PDF
Source: https://github.com/arturogj92/moltolicism/tree/main/skills/html-to-pdf
Command: npx skills add https://github.com/arturogj92/moltolicism --skill html-to-pdf-arturogj92

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill converts HTML pages or URLs into PDF documents to preserve layout and styling for offline access and distribution.

Core Features & Use Cases

  • Full page rendering with CSS support and JavaScript execution
  • Custom page size, margins, headers and footers
  • Converts both URLs and local HTML files to PDFs
  • Use cases include archiving web content, generating reports, and sharing web pages as standalone documents

Quick Start

Run: python3 scripts/html_to_pdf.py https://example.com output.pdf Run: python3 scripts/html_to_pdf.py page.html output.pdf

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 an HTML page to a PDF while preserving CSS and JavaScript rendering?

Converting HTML to PDF with full CSS and JavaScript rendering requires a headless browser engine. This Skill uses Playwright or Puppeteer with Chrome or Chromium to execute page scripts and generate a PDF that matches the live web layout.

Can I use a URL instead of a local file for HTML to PDF conversion?

Yes, HTML to PDF conversion supports both live URLs and local HTML files. You provide the source path as an argument, and the rendering engine fetches and processes the page content before generating the PDF output document.

Do I need Playwright or Puppeteer installed to render HTML to PDF?

Yes, you need either Playwright or Puppeteer and a Chrome or Chromium browser installed. These dependencies provide the headless rendering environment required to execute JavaScript and apply CSS before generating the PDF.

What is the best way to archive web content as a standalone PDF document?

Archiving web content as a PDF is done by rendering the page with a headless browser to capture its visual state. This approach ensures all CSS styling and JavaScript-generated content are preserved in the final offline document.

Can I customize page size and margins when converting URLs to PDFs?

Yes, custom page sizes, margins, headers, and footers are supported during HTML to PDF conversion. These options are passed to the rendering engine to control the final document layout and formatting.

Why does my HTML to PDF conversion fail to load dynamic content?

Dynamic content rendering fails if the headless browser environment lacks JavaScript execution support or a proper Chromium installation. This Skill handles full page rendering by executing scripts through Playwright or Puppeteer before capturing the PDF.