Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present.
60
70%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Failed to scan
The risk profile of this skill
Fix and improve this skill with Tessl
tessl review fix ./scientific-skills/Other/html-to-pdf/SKILL.mdRun this minimal command first to verify the supported execution path:
python scripts/validate_skill.py --help-) piping.--rtl).document.fonts.ready, plus configurable extra wait.npm install (Chromium bundled by default)--executable-path or PUPPETEER_EXECUTABLE_PATH)cd d:/skills/html-to-pdf
npm installnode assets/html-to-pdf.js input.html output.pdfnode assets/html-to-pdf.js https://example.com page.pdfnode assets/html-to-pdf.js hebrew.html hebrew.pdf --rtlecho "<h1>Example Title</h1>" | node assets/html-to-pdf.js - output.pdf --rtlnode assets/html-to-pdf.js https://example.com page.pdf --executable-path="C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"Or via environment variable:
set PUPPETEER_EXECUTABLE_PATH=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
node assets/html-to-pdf.js https://example.com page.pdfCreate single-page.html:
<!doctype html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;700&display=swap" rel="stylesheet">
<style>
@page { size: A4; margin: 0; }
/* Keep the page box exact; avoid backgrounds here to prevent extra pages */
html, body {
width: 210mm;
height: 297mm;
margin: 0;
padding: 0;
overflow: hidden;
}
/* Put backgrounds on a full-size container instead */
.container {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 20mm;
font-family: "Heebo", sans-serif;
direction: rtl;
text-align: right;
background: #f5f5f5;
overflow-wrap: break-word;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="container">
<h1>כותרת לדוגמה</h1>
<p>תוכן לדוגמה שמודפס כעמוד יחיד.</p>
</div>
</body>
</html>Generate the PDF:
node assets/html-to-pdf.js single-page.html single-page.pdf --format=A4 --margin=0 --wait=1000-)networkidle0 (resources finished loading),document.fonts.ready,--wait=<ms> (default 1000) for late JS/font rendering.--rtl forces RTL regardless of detection.To avoid unexpected blank pages, ensure the content fits exactly within the page box:
html or body (common cause of extra pages)..container) instead.overflow: hidden on html, body for strict single-page output.--scale (e.g., 0.9, 0.8)--margin (e.g., 10mm, 0)| Parameter | Description | Default |
|---|---|---|
--format=<format> | Page size: A4, Letter, Legal, A3, A5 | A4 |
--landscape | Landscape orientation | false |
--margin=<value> | Uniform margin (e.g., 20mm, 1in) | 20mm |
--margin-top=<value> | Top margin | 20mm |
--margin-right=<value> | Right margin | 20mm |
--margin-bottom=<value> | Bottom margin | 20mm |
--margin-left=<value> | Left margin | 20mm |
--scale=<number> | Scale factor (0.1-2.0) | 1 |
--background | Print background graphics | true |
--no-background | Disable background printing | - |
--header=<html> | Header HTML template | - |
--footer=<html> | Footer HTML template | - |
--wait=<ms> | Extra wait time for fonts/JS | 1000 |
--rtl | Force RTL direction | Auto-detect |
@page) and supports print CSS.deviceScaleFactor to 2 to improve output clarity.After each generation, visually verify the PDF:
--scale--marginIf it still fails after 5 attempts, the HTML layout must be corrected (e.g., reduce fixed heights, fix oversized elements, ensure wrapping).
html_to_pdf_result.md unless the skill documentation defines a better convention.Run this minimal verification path before full execution when possible:
No local script validation step is required for this skill.Expected output format:
Result file: html_to_pdf_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any63c61d3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.