← Back to Skills Marketplace
hankagent

HTML to PDF

by HankAgent · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
398
Downloads
0
Stars
2
Active Installs
1
Versions
Install in OpenClaw
/install html-to-pdf
Description
Convert HTML files and URLs to PDF using Puppeteer. Use when a user needs to convert HTML documents, web pages, or reports to PDF format with custom formatti...
README (SKILL.md)

HTML to PDF Conversion

Convert HTML files and web pages to professional PDF documents using Puppeteer.

Quick Start

CLI Usage

node scripts/html-to-pdf.js input.html output.pdf
node scripts/html-to-pdf.js input.html output.pdf A4
node scripts/html-to-pdf.js https://example.com output.pdf A4

Programmatic Usage

const convertHtmlToPdf = require('./scripts/html-to-pdf.js');

// Simple conversion
await convertHtmlToPdf('input.html', 'output.pdf');

// With options
await convertHtmlToPdf('input.html', 'output.pdf', {
  format: 'Letter',
  landscape: true,
  margin: { top: '20mm', bottom: '20mm' }
});

Features

  • ✅ Convert local HTML files
  • ✅ Convert web URLs (http/https)
  • ✅ Customizable page formats (A4, Letter, etc.)
  • ✅ Custom margins and spacing
  • ✅ Landscape/portrait modes
  • ✅ Print backgrounds
  • ✅ Headers and footers
  • ✅ Page ranges
  • ✅ Zoom scaling

Common Options

Option Type Default Notes
format string 'A4' A4, Letter, A3, A5, etc.
landscape boolean false Landscape orientation
margin object 10mm all { top, right, bottom, left }
scale number 1 0.1 to 2.0
printBackground boolean true Include background colors
displayHeaderFooter boolean false Show header/footer

Advanced Usage

With Headers and Footers

await convertHtmlToPdf('page.html', 'output.pdf', {
  displayHeaderFooter: true,
  headerTemplate: '\x3Cdiv>Page \x3Cspan class="pageNumber">\x3C/span>\x3C/div>',
  footerTemplate: '\x3Cdiv>© 2024\x3C/div>',
  margin: { top: '40px', bottom: '40px' }
});

Specific Page Ranges

await convertHtmlToPdf('document.html', 'pages-1-5.pdf', {
  pageRanges: '1-5'
});

Installation

Requires Node.js and npm:

npm install puppeteer

Reference

For complete API documentation and all available options, see api.md.

Usage Guidance
This skill appears coherent and implements HTML/URL→PDF conversion using Puppeteer. Before installing, note: (1) npm install puppeteer will download Chromium (~200MB) unless you point to a system Chrome binary, (2) converting remote URLs causes the embedded browser to fetch and execute page resources and scripts—only render URLs you trust, and (3) when converting local files the script will read the specified input path and write the output PDF (ensure you pass only files you intend to expose). The skill does not request credentials or perform network exfiltration beyond normal page loads. If you need stricter controls, run conversions in an isolated environment or provide only local files/approved URLs.
Capability Analysis
Type: OpenClaw Skill Name: html-to-pdf Version: 1.0.0 The skill provides HTML-to-PDF conversion using Puppeteer, which involves high-risk capabilities such as arbitrary network access (SSRF risk) and local file system access via the `file://` protocol (LFI risk) in `scripts/html-to-pdf.js`. While these features are aligned with the stated purpose in `SKILL.md`, the script lacks input validation, and `references/setup.md` suggests disabling the browser sandbox (`--no-sandbox`), which significantly increases the attack surface if the agent processes untrusted input.
Capability Assessment
Purpose & Capability
Name/description (HTML→PDF via Puppeteer) align with the included script and docs. The script implements conversion of local files or URLs to PDF and exposes programmatic and CLI usage consistent with the description.
Instruction Scope
SKILL.md and references only instruct installing Puppeteer and running the script. The code accesses the provided input path or URL and writes the specified output PDF; it does not read arbitrary other files, access unrelated environment variables, or send data to unexpected endpoints. (It does cause the browser to load remote pages when given URLs, which is expected for rendering.)
Install Mechanism
No install spec in registry (instruction-only). The README instructs npm install puppeteer, which is normal but will download a Chromium binary (~200MB) unless the user sets PUPPETEER_SKIP_CHROMIUM_DOWNLOAD / points to system Chrome. This network download and large binary are expected for Puppeteer but worth noting.
Credentials
The skill declares no required env vars or credentials. The documentation mentions optional Puppeteer-related env vars (PUPPETEER_EXECUTABLE_PATH, PUPPETEER_SKIP_CHROMIUM_DOWNLOAD) which are reasonable and proportionate to the task.
Persistence & Privilege
always is false and the skill does not request persistent/privileged installation or modify other skills. Autonomous invocation is allowed (platform default) but the skill's behavior is self-contained.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install html-to-pdf
  3. After installation, invoke the skill by name or use /html-to-pdf
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: Convert HTML files and URLs to PDF using Puppeteer
Metadata
Slug html-to-pdf
Version 1.0.0
License MIT-0
All-time Installs 2
Active Installs 2
Total Versions 1
Frequently Asked Questions

What is HTML to PDF?

Convert HTML files and URLs to PDF using Puppeteer. Use when a user needs to convert HTML documents, web pages, or reports to PDF format with custom formatti... It is an AI Agent Skill for Claude Code / OpenClaw, with 398 downloads so far.

How do I install HTML to PDF?

Run "/install html-to-pdf" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is HTML to PDF free?

Yes, HTML to PDF is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does HTML to PDF support?

HTML to PDF is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created HTML to PDF?

It is built and maintained by HankAgent (@hankagent); the current version is v1.0.0.

💬 Comments