Agent skill

HTML To PDF

by aipoch in aipoch/medical-research-skills

Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present.

MITAuto-check passedDocuments & Office

Install HTML To PDF

skills CLI
$ npx skills add aipoch/medical-research-skills --skill html-to-pdf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills html-to-pdf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/scientific-skills/Other/html-to-pdf .claude/skills/html-to-pdf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
html-to-pdf
GitHub stars
2k
Token cost
~2.4k tokens
SKILL.md length
930 words
Files
3,740 (incl. scripts, assets)
Skills in repo
578
Repo updated
First seen
Licence
MIT

At a glance

Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present.

  • Works in 7 steps: Install → Run (local HTML → PDF) → Run (URL → PDF) → …
  • Tasks that involve PDF
  • SKILL.md covers Validation Shortcut, When to Use, Key Features and Dependencies, plus 11 more sections
  • Runs Batch, PowerShell and JavaScript scripts from its folder; calls node, npm and python; reaches fonts.googleapis.com

What it does

HTML To PDF is an agent skill from aipoch/medical-research-skills. Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3742 other files, including scripts and assets (for example `assets/html-to-pdf.js` and `html-to-pdf_audit_result_v2.json`).

It sits in Documents & Office, covering PDF. It works with Puppeteer. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Tasks that involve PDF

Example prompts

  • “/html-to-pdf”

Requirements

  • Python 3
  • Node.js
  • PowerShell

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Install
  2. Run (local HTML → PDF)
  3. Run (URL → PDF)
  4. Force RTL (Hebrew/Arabic)
  5. Pipe HTML via stdin
  6. Use a specific browser executable (optional)
  7. A complete, runnable single-page A4 example (recommended pattern)

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Batch, PowerShell and JavaScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • npm
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • fonts.googleapis.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

HTML To PDF loads about 2.4k tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 930 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~38
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 930 words, ~2,409 tokens.

Download SKILL.mdSave it as .claude/skills/html-to-pdf/SKILL.md (or your agent's skills folder). This skill also uses 3739 other files; get the full folder from GitHub.
name
html-to-pdf
description
Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

Validation Shortcut

Run this minimal command first to verify the supported execution path:

bash
python scripts/validate_skill.py --help

When to Use

  • Export a web page (URL) to a PDF with Chrome-accurate rendering (CSS Grid/Flexbox, backgrounds, web fonts).
  • Convert a local HTML report/invoice into a print-ready PDF (A4/Letter) with predictable margins and scaling.
  • Generate single-page PDFs that must fit exactly on one page (posters, certificates, one-page invoices).
  • Produce RTL documents (Hebrew/Arabic) where direction must be correct and fonts must render reliably.
  • Render dynamic HTML that requires JavaScript execution before printing (charts, client-side templates).

Key Features

  • Chrome-quality rendering via Puppeteer (headless Chromium/Chrome/Edge).
  • Input flexibility: local HTML file, URL, or stdin (-) piping.
  • RTL support: automatic RTL detection with an option to force RTL (--rtl).
  • Print controls: format, landscape, margins (uniform or per-side), scale, background printing.
  • Header/Footer templates: inject HTML header/footer.
  • Stability for fonts/resources: waits for network idle and document.fonts.ready, plus configurable extra wait.

Dependencies

  • Node.js: >= 16 (recommended)
  • npm: >= 8
  • puppeteer: installed via npm install (Chromium bundled by default)
  • Optional browser executable (if not using bundled Chromium):
    • Google Chrome or Microsoft Edge (path provided via --executable-path or PUPPETEER_EXECUTABLE_PATH)

Example Usage

1) Install
bash
cd d:/skills/html-to-pdf
npm install
2) Run (local HTML → PDF)
bash
node assets/html-to-pdf.js input.html output.pdf
3) Run (URL → PDF)
bash
node assets/html-to-pdf.js https://example.com page.pdf
4) Force RTL (Hebrew/Arabic)
bash
node assets/html-to-pdf.js hebrew.html hebrew.pdf --rtl
5) Pipe HTML via stdin
bash
echo "<h1>Example Title</h1>" | node assets/html-to-pdf.js - output.pdf --rtl
6) Use a specific browser executable (optional)
bash
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:

bash
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:

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:

bash
node assets/html-to-pdf.js single-page.html single-page.pdf --format=A4 --margin=0 --wait=1000

Implementation Details

Rendering approach
  • Uses Puppeteer to load either:
    • a local HTML file, or
    • a remote URL, or
    • HTML from stdin (-)
  • Wait strategy (to reduce missing fonts/assets):
    • waits for networkidle0 (resources finished loading),
    • waits for document.fonts.ready,
    • then waits an additional --wait=<ms> (default 1000) for late JS/font rendering.
RTL handling
  • Default behavior: auto-detect RTL content (e.g., Hebrew/Arabic) and apply RTL direction.
  • Override: --rtl forces RTL regardless of detection.
Page-fit rule (single-page PDFs)

To avoid unexpected blank pages, ensure the content fits exactly within the page box:

  • Do not set backgrounds on html or body (common cause of extra pages).
  • Put backgrounds on a full-height container (.container) instead.
  • Use overflow: hidden on html, body for strict single-page output.
  • If overflow persists, adjust:
    • --scale (e.g., 0.9, 0.8)
    • --margin (e.g., 10mm, 0)
CLI parameters
ParameterDescriptionDefault
--format=<format>Page size: A4, Letter, Legal, A3, A5A4
--landscapeLandscape orientationfalse
--margin=<value>Uniform margin (e.g., 20mm, 1in)20mm
--margin-top=<value>Top margin20mm
--margin-right=<value>Right margin20mm
--margin-bottom=<value>Bottom margin20mm
--margin-left=<value>Left margin20mm
--scale=<number>Scale factor (0.1-2.0)1
--backgroundPrint background graphicstrue
--no-backgroundDisable background printing-
--header=<html>Header HTML template-
--footer=<html>Footer HTML template-
--wait=<ms>Extra wait time for fonts/JS1000
--rtlForce RTL directionAuto-detect
Quality settings
  • Uses Chrome print styles (@page) and supports print CSS.
  • Sets deviceScaleFactor to 2 to improve output clarity.

After each generation, visually verify the PDF:

  • No extra blank pages (vertical overflow).
  • No clipped text (horizontal overflow).
  • If issues occur, iterate up to 5 attempts:
    1. default
    2. reduce --scale
    3. reduce --margin
    4. reduce both further
    5. fix HTML/CSS (wrap long words, ensure container sizing)

If it still fails after 5 attempts, the HTML layout must be corrected (e.g., reduce fixed heights, fix oversized elements, ensure wrapping).

When Not to Use

  • Do not use this skill when the required source data, identifiers, files, or credentials are missing.
  • Do not use this skill when the user asks for fabricated results, unsupported claims, or out-of-scope conclusions.
  • Do not use this skill when a simpler direct answer is more appropriate than the documented workflow.
Show full SKILL.md (354 more words)Show less

Required Inputs

  • A clearly specified task goal aligned with the documented scope.
  • All required files, identifiers, parameters, or environment variables before execution.
  • Any domain constraints, formatting requirements, and expected output destination if applicable.
  1. Validate the request against the skill boundary and confirm all required inputs are present.
  2. Select the documented execution path and prefer the simplest supported command or procedure.
  3. Produce the expected output using the documented file format, schema, or narrative structure.
  4. Run a final validation pass for completeness, consistency, and safety before returning the result.

Output Contract

  • Return a structured deliverable that is directly usable without reformatting.
  • If a file is produced, prefer a deterministic output name such as html_to_pdf_result.md unless the skill documentation defines a better convention.
  • Include a short validation summary describing what was checked, what assumptions were made, and any remaining limitations.

Validation and Safety Rules

  • Validate required inputs before execution and stop early when mandatory fields or files are missing.
  • Do not fabricate measurements, references, findings, or conclusions that are not supported by the provided source material.
  • Emit a clear warning when credentials, privacy constraints, safety boundaries, or unsupported requests affect the result.
  • Keep the output safe, reproducible, and within the documented scope at all times.

Failure Handling

  • If validation fails, explain the exact missing field, file, or parameter and show the minimum fix required.
  • If an external dependency or script fails, surface the command path, likely cause, and the next recovery step.
  • If partial output is returned, label it clearly and identify which checks could not be completed.

Quick Validation

Run this minimal verification path before full execution when possible:

text
No local script validation step is required for this skill.

Expected output format:

text
Result file: html_to_pdf_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any

Deterministic Output Rules

  • Use the same section order for every supported request of this skill.
  • Keep output field names stable and do not rename documented keys across examples.
  • If a value is unavailable, emit an explicit placeholder instead of omitting the field.

Completion Checklist

  • Confirm all required inputs were present and valid.
  • Confirm the supported execution path completed without unresolved errors.
  • Confirm the final deliverable matches the documented format exactly.
  • Confirm assumptions, limitations, and warnings are surfaced explicitly.

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3,739 other files (scripts, assets) in scientific-skills/Other/html-to-pdf of aipoch/medical-research-skills.

  • SKILL.md
  • assets/html-to-pdf.js
  • html-to-pdf_audit_result_v2.json
  • node_modules/.bin/browsers
  • node_modules/.bin/browsers.cmd
  • node_modules/.bin/browsers.ps1
  • node_modules/.bin/escodegen
  • node_modules/.bin/escodegen.cmd
  • node_modules/.bin/escodegen.ps1
  • node_modules/.bin/esgenerate
  • node_modules/.bin/esgenerate.cmd
  • node_modules/.bin/esgenerate.ps1
  • node_modules/.bin/esparse
  • node_modules/.bin/esparse.cmd
  • node_modules/.bin/esparse.ps1
  • node_modules/.bin/esvalidate
  • node_modules/.bin/esvalidate.cmd
  • node_modules/.bin/esvalidate.ps1
  • … and 3,722 more

Open the folder on GitHubat commit 686e09d

Compare with similar skills

HTML To PDF next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

HTML To PDF compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
HTML To PDF this skillaipoch/medical-research-skills2k—~2.4kAutomated safety check: PassMIT
Document Generation PDFcuriositech/some_claude_skills243—~5.1kAutomated safety check: PassMIT
Md2pdf Exportwentorai/Research-Claw858—~2.1kAutomated safety check: NotesCustom licence
Export PDFbluzir/claude-code-design106—~811Automated safety check: PassNone
Puppeteer Skillsickn33/agentic-awesome-skills47k1 repos~1.2kAutomated safety check: PassMIT
Cloudflare Browser Renderingeinverne/dotfiles121—~4.9kAutomated safety check: PassGPL-3.0

Similar skills

  • Document Generation PDF

    curiositech/some_claude_skills

    Generate, fill, and assemble PDF documents at scale. An agent skill from curiositech/some_claude_skills.

    243 GitHub stars~5.1k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Md2pdf Export

    wentorai/Research-Claw

    Convert Markdown files to PDF, PNG, or JPEG using headless Chrome (Puppeteer), following the same methodology as VS Code's Markdown Preview Enhanced extension.

    858 GitHub stars~2.1k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check: notes
  • Export PDF

    bluzir/claude-code-design

    Export an HTML artifact to PDF via headless Chromium (puppeteer Page.pdf).

    106 GitHub stars~811 tokensUpdated 5 mo ago
    Documents & OfficeAuto-check passed
  • Puppeteer Skill

    sickn33/agentic-awesome-skills

    Generates Puppeteer scripts for browser automation, scraping, and PDF generation.

    47k GitHub starsUsed in 1 repo~1.2k tokens
    Productivity & AutomationAuto-check passed
  • Guide for implementing Cloudflare Browser Rendering - a headless browser automation API for screenshots, PDFs, web scraping, and testing.

    121 GitHub stars~4.9k tokensUpdated 1 mo ago
    Productivity & AutomationAuto-check passed
  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    782 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes

More from aipoch/medical-research-skills

All 578 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 22 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 22 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 22 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 22 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 22 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 22 days ago
    Auto-check passed

Works with

Questions about HTML To PDF

What does HTML To PDF do?

Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present. HTML To PDF is an agent skill from aipoch/medical-research-skills. Convert HTML files or URLs to high-fidelity PDFs using Puppeteer; auto-detects or forces RTL for Hebrew/Arabic when RTL content is present.

When should I use HTML To PDF?

HTML To PDF fits situations like: tasks that involve PDF.

How do I install HTML To PDF in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill html-to-pdf -a claude-code`. Or copy the skill folder (scientific-skills/Other/html-to-pdf in aipoch/medical-research-skills) into .claude/skills/html-to-pdf in your project. Claude Code loads it when a task matches its description.

How do I install HTML To PDF in Codex?

Run `npx skills add aipoch/medical-research-skills --skill html-to-pdf -a codex`. Or copy the skill folder (scientific-skills/Other/html-to-pdf in aipoch/medical-research-skills) into .agents/skills/html-to-pdf in your project. Codex loads it when a task matches its description.

Can I use HTML To PDF in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill html-to-pdf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/html-to-pdf, .gemini/skills/html-to-pdf, .github/skills/html-to-pdf and .opencode/skills/html-to-pdf in your project.

What does HTML To PDF need to run?

Going by SKILL.md and its folder, HTML To PDF needs Windows cmd, PowerShell and JavaScript for the scripts in its folder and the command-line tools its instructions call (node, npm and python). Our summary lists: Python 3; Node.js; PowerShell.

Does HTML To PDF access the network?

SKILL.md names 1 domain. In commands or code: fonts.googleapis.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is HTML To PDF safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does HTML To PDF use?

HTML To PDF is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does HTML To PDF use?

About 2.4k tokens (SKILL.md is roughly 9.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to HTML To PDF?

Skills that share tags, products or a category with HTML To PDF: Document Generation PDF (curiositech/some_claude_skills, 243 stars), Md2pdf Export (wentorai/Research-Claw, 858 stars), Export PDF (bluzir/claude-code-design, 106 stars) and Puppeteer Skill (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains HTML To PDF?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,978 GitHub stars. The repository holds 578 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.