pdf-to-html

Converts PDFs into self-contained HTML files preserving images, tables, and reading order.

1.4k|216|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/daymade/claude-code-skills --skill pdf-to-html
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-to-html
Source: https://github.com/daymade/claude-code-skills/tree/main/daymade-docs/pdf-to-html
Command: npx skills add https://github.com/daymade/claude-code-skills --skill pdf-to-html

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymupdf, Pillow, numpy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Reading or sharing a PDF as a clean web page is hard: naive converters lose images, break tables, scramble reading order, or produce multi-file outputs with missing assets. This Skill rebuilds a PDF into one portable, styled HTML file — and can optionally translate it into another language while keeping every figure intact.

Core Features & Use Cases

  • Structured extraction and rebuild: Uses PyMuPDF to extract text blocks with font sizes and images, then infers heading levels from font size and inlines content images as compressed base64 for a single portable file.
  • Optional faithful translation: Runs a parallel Dynamic Workflow that translates page units, captions data charts, and reconciles terminology with a fixed glossary — while copying numbers and proper nouns verbatim.
  • Mandatory visual verification: Renders the output with headless Chrome and slices it into readable PNG segments so layout problems (tofu fonts, clipped tables) are caught before delivery.
  • Use Case: A user asks to "turn this PDF report into a Chinese web page" — the Skill extracts the structure, translates the text, keeps all charts in place, and delivers one double-clickable HTML file.

Quick Start

Convert the attached PDF report into a single readable HTML file, and translate it into Chinese while keeping all the charts and images.

Frequently Asked Questions about pdf-to-html

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a PDF to HTML while keeping images and tables?

Extract the PDF structure with PyMuPDF to get text blocks, font sizes, and images in reading order, then rebuild them into HTML with headings inferred from font size and content images inlined as base64. This produces one self-contained HTML file with figures preserved.

How can I translate a PDF into another language without losing the charts?

Extract text units with stable per-page IDs, translate them in parallel with a shared glossary, and merge the translations back as overlays onto the original layout. Charts stay as original images, optionally with a translated caption explaining the data.

Does PDF to HTML conversion work on scanned documents?

No. Scanned or image-only PDFs have no text layer for PyMuPDF to extract. Run OCR first with a tool like ocrmypdf to add a text layer, then convert the result to HTML.

Why does my converted HTML look wrong even though the text is correct?

Text-correct is not render-correct: fonts can fall back to tofu boxes, tables can overflow, and headings can wrap badly. Render the HTML with headless Chrome and visually inspect screenshot segments to catch these layout failures.

What are the limitations of converting PDF tables to HTML?

Complex multi-column tables lose their grid structure because PyMuPDF reads tables as text blocks, not cells; the text stays readable but alignment flattens. Tables embedded as images survive intact, and pandoc-based Markdown conversion is better when the grid matters.