scientific-skills/Others/html-to-pdf/SKILL.md
Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present.
npx skillsauth add aipoch/medical-research-skills html-to-pdfInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run 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 install
node assets/html-to-pdf.js input.html output.pdf
node assets/html-to-pdf.js https://example.com page.pdf
node assets/html-to-pdf.js hebrew.html hebrew.pdf --rtl
echo "<h1>Example Title</h1>" | node assets/html-to-pdf.js - output.pdf --rtl
node 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.pdf
Create 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 any
tools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.