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...
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 168 · 1 current installs · 1 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & 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.
Assessment
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.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
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: '<div>Page <span class="pageNumber"></span></div>',
footerTemplate: '<div>© 2024</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.
Files
4 totalSelect a file
Select a file to preview.
Comments
Loading comments…
