pdf-to-html
An agent skill by daymade, from daymade/claude-code-skills. Tags: conversion, documents, html, pdf, web.
What it does
Converts a PDF into one self-contained, readable HTML file that preserves images, tables, charts and reading order — optionally translating it into another language while keeping every figure. Uses structured extraction (PyMuPDF), font-size-driven layout, compressed base64-inlined images (a single portable file), and mandatory headless-Chrome visual verification. Use whenever someone wants to READ a PDF as a web page or clean document, turn a PDF into HTML, or translate a PDF into another language while keeping its images/tables/charts intact — e.g. "PDF 转 HTML", "把这个 PDF 转成中文网页版", "make this report readable", "translate this PDF but don't lose the charts", "I just want to read this PDF on my phone". Distinct from doc-to-markdown (plain Markdown text) and pdf-creator (Markdown→PDF) — this one produces a styled, image-faithful HTML reading experience.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add daymade/claude-code-skills --skill pdf-to-html
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/daymade/claude-code-skills
cp -r claude-code-skills/daymade-docs/pdf-to-html ~/.claude/skills/pdf-to-html
Safety box score
Grade B, low risk: 18 of 100 risk points, rated 2026-10-21. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill converts PDFs into a single self-contained HTML file using local Python scripts and a headless Chrome verification pass. The main risks are local code execution in the browser subprocess, runtime fetching of Python dependencies, and file writes/deletes for extracted pages and screenshots.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 2 (moderate) | The workflow runs local scripts and spawns Chrome via `subprocess.Popen([... "--headless" ... "--screenshot" ...])`, so it executes external code as part of normal use. |
| Network access | 1 (low) | `SKILL.md` requires `uv run --with pymupdf`, `--with Pillow`, and `--with numpy`, which typically downloads packages at runtime, but the scripts themselves do not contact remote hosts. |
| Filesystem reach | 1 (low) | It writes extracted artifacts and output HTML (`structure.json`, `images/`, `pages/`, `--out`) and the verifier deletes temporary screenshots with `os.remove(...)`, but this is bounded to user-chosen paths. |
| Secrets & credentials | 0 (none) | No credential stores, browser sessions, key files, `.env` files, or token-handling logic appear in the skill files. |
| Privilege & persistence | 0 (none) | There is no sudo, service registration, shell startup editing, or global system reconfiguration in the scripts or docs. |
| Instruction hijack surface | 0 (none) | The files contain workflow guidance and fidelity rules, but no instructions to ignore higher-priority rules, fetch remote prompts, or hide actions. |
| Irreversible actions | 0 (none) | The skill only converts local PDFs to HTML and asks for visual review; it does not publish, send, pay, deploy, or delete external resources. |
| Transparency | 1 (low) | The skill relies on runtime package resolution via `uv run --with ...` rather than vendored/pinned dependencies, so part of the executed code comes from external packages not fixed in the repo. |
Before installing
- Read `scripts/verify_render.py` and note it runs Chrome with `--no-sandbox`.
- Check whether you are comfortable with `uv run --with ...` pulling packages at runtime.
- If you will process sensitive PDFs, use a scratch directory because the skill writes `images/`, `pages/`, and `output.html`.
Rated 2026-10-21 by an automated review of 6 files from the skill's repository.
Source
- Repository
- daymade/claude-code-skills (all skills from this repository)
- Path
- daymade-docs/pdf-to-html/SKILL.md
- Branch
- main
- Updated
- 2026-09-20
Related skills
- stitch::extract-static-html — Extract self-contained static HTML from a built web application or React components by inlining CSS and images.
- doc-to-markdown — Converts DOCX/PDF/PPTX to high-quality Markdown with automatic post-processing.
- pdf-creator — Convert markdown files to professional PDF documents with proper Chinese font support, theme system, and visual self-check.
- photo-to-scanned-pdf — Two pipelines ending at a scanner-look PDF.
- cro — When the user wants to optimize, improve, or increase conversions on any marketing page or form — including homepage, landing pages, pricing pages.
- lead-magnets — When the user wants to create, plan, or optimize a lead magnet for email capture or lead generation.