← 返回 Skills 市场
398
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (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.
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install html-to-pdf - 安装完成后,直接呼叫该 Skill 的名称或使用
/html-to-pdf触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Convert HTML files and URLs to PDF using Puppeteer
元数据
常见问题
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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 398 次。
如何安装 HTML to PDF?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install html-to-pdf」即可一键安装,无需额外配置。
HTML to PDF 是免费的吗?
是的,HTML to PDF 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
HTML to PDF 支持哪些平台?
HTML to PDF 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 HTML to PDF?
由 HankAgent(@hankagent)开发并维护,当前版本 v1.0.0。
推荐 Skills