s860-pdf-to-html

s860-pdf-to-html: perform PDF-to-HTML conversion using local tools without requiring a business account, API key, or cloud services.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "s860-pdf-to-html" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-71df9972446209c6fdb36dbb37f744cb4a6df3f68dd09c1d9dffa47a4697e9a0. Verify the upstream source and version against https://skillhub.cn/skills/user_f4fc8899/s860-pdf-to-html before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

s860-pdf-to-html: perform PDF-to-HTML conversion using local tools without requiring a business account, API key, or cloud services.

0 Downloads

Introduction source: third_party · user_f4fc8899 · 1.0.2 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
**Use** when the goal is to *read* a PDF as HTML/web page, to convert a PDF to a styled HTML document, or to translate a PDF into another language while keeping its figures and tables. **doc-to-markdown** instead if they want plain Markdown text (no styling, figures optional). **pdf-creator** instead for the reverse direction (Markdown → PDF).
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: s860-pdf-to-html
description: '中文:使用本地工具完成PDF 转 HTML相关任务,不要求业务账号、API Key 或云端服务。 English: Use local tools for PDF to HTML tasks without business accounts, API keys, or cloud services.'
slug: s860-pdf-to-html
version: 1.0.2
displayName: PDF 转 HTML / PDF to HTML
summary: '中文:PDF 转 HTML,提供本地可复用的工作流、输入输出说明和质量检查。 English: PDF to HTML, with reusable local workflows, input/output guidance, and quality checks.'
license: MIT

PDF 转 HTML / PDF to HTML · 技能 / Skill

交付说明 / Delivery notes

中文:这是一个个人 SkillPay 办公/通用技能包,标题、摘要和交付边界均提供中文与 English 双语版本。它用于本地文件、文本或结构化数据处理,具体输入、输出、限制和质量检查以正文为准。

English: This is a personal SkillPay office/general-purpose package with bilingual metadata and delivery boundaries. It is intended for local file, text, or structured-data workflows; follow the body for exact inputs, outputs, limitations, and quality checks.

  • 账号与凭证 / Accounts and credentials:不要求第三方账号、密码、API Key 或 OAuth 凭证。 / No third-party account, password, API key, or OAuth credential is required.
  • 外部服务边界 / External-service boundary:不代用户登录、抓取或调用云端服务;正文提到的工具只按本地可用环境执行。 / It does not log in, scrape, or call cloud services on the user's behalf; mentioned tools are used only when available locally.
  • 计费档位 / Pricing tier:SkillHub 发布页设置为 0.01 CNY/call(0.01 元/次)。 / Set the SkillHub publishing price to 0.01 CNY/call.
  • 许可证 / License:来源清单已确认许可证,当前包将其写入元数据。 / The source manifest confirms the license, which is recorded in the package metadata.

Turn a PDF into a single, self-contained, readable HTML file — images, tables, charts and reading order preserved — and optionally translate it, keeping every figure in place.

The pipeline is extract → look → (translate) → build → verify. The middle "look" and final "verify" steps are where faithfulness actually comes from: a PDF is a layout, not just a text stream, so you read the rendered pages before building and the rendered HTML before delivering.

This skill runs inline (no context: fork): translation orchestrates a Dynamic Workflow, and a subagent cannot spawn one.

When to use / not use

  • Use when the goal is to read a PDF as HTML/web page, to convert a PDF to a styled HTML document, or to translate a PDF into another language while keeping its figures and tables.
  • doc-to-markdown instead if they want plain Markdown text (no styling, figures optional).
  • pdf-creator instead for the reverse direction (Markdown → PDF).

What it does NOT do

  • Scanned/image-only PDFs (no text layer): OCR first (e.g. ocrmypdf), then use this.
  • Complex multi-column tables: cell text is preserved and readable, but column alignment can flatten into a text flow — PyMuPDF reads a table as text blocks, not a grid, so the grid lines are gone. Tables that are images in the PDF survive as images. If the table's grid structure is essential, use doc-to-markdown (pandoc rebuilds real tables) or convert that page separately.
  • Pixel-perfect facsimile: output is a clean re-flow that keeps images and reading order, not a 1:1 copy of the original page layout.
  • Rewriting: it translates and re-lays-out; it does not summarize, add a TL;DR, or editorialize. Faithfulness is the point (see Fidelity below).

Dependencies

uv (runs Python with inline deps), Google Chrome or Chromium (visual verification). Python packages come via uv run --with: PyMuPDF, Pillow, numpy. Nothing to pre-install beyond Chrome and uv.

Workflow

Copy this checklist and tick as you go:

- [ ] 1. Extract structure + render pages   (extract_pdf.py)
- [ ] 2. Read pages/*.png — SEE the layout, find content vs decorative images
- [ ] 3. (only if translating) run the translation workflow
- [ ] 4. Build the single-file HTML          (build_html.py)
- [ ] 5. Verify visually                      (verify_render.py → Read every segment)
- [ ] 6. Deliver the .html

1. Extract

uv run --with pymupdf python scripts/extract_pdf.py input.pdf

Writes input-build/ with structure.json (text blocks with font sizes + image blocks flagged decorative), images/, and pages/ (one PNG per page).

2. Look before you build

Read input-build/pages/*.png. This is not optional: you need to see the real layout, confirm which images are content vs decoration, and spot tables/charts. For a long PDF, read every page; for a short one it's quick. This is also where you understand the document well enough to translate it well.

3. Translate (optional)

Only if the user asked for another language. Read references/translation_workflow.md and follow it: a Dynamic Workflow translates pages in parallel, captions data charts, and reconciles terminology. It produces two overlay files (units.json, caps.json) that step 4 consumes. Do not hand-translate inline for anything longer than a page — the workflow keeps terminology consistent and is far faster.

4. Build

# original-language HTML
uv run --with Pillow python scripts/build_html.py input-build/structure.json --out output.html

# translated HTML (overlays from step 3)
uv run --with Pillow python scripts/build_html.py input-build/structure.json --out output.html \
    --translation input-build/units.json --captions input-build/caps.json --lang zh-CN

build_html.py is data-driven: it infers heading levels from font size (most common size = body; larger steps up to h3/h2/h1), drops decorative images, and inlines content images as compressed base64 → one portable file. It is not hand-tuned to any document. If a particular PDF has an unusual structure (e.g. multi-column, sidebars, a figure the size heuristic misreads), read the script and adjust — it's short and meant to be edited per document.

5. Verify visually (mandatory)

uv run --with Pillow --with numpy python scripts/verify_render.py output.html

Then *Read every `seg-.png`** and check: fonts render (no tofu boxes), no clipped tables/figures, headings/lists look right, all expected images present. Text being correct does not mean the render is correct (failure_cases #7). Fix and re-verify until it's clean.

A quick structural cross-check is fine too, but count occurrences correctly: grep -o '<figure>' output.html | wc -l — not grep -c (failure_cases #1).

6. Deliver

Hand over the single .html. It's self-contained (images inlined), so it opens with a double-click and nothing can go missing.

Scripts

Script Run with Purpose
scripts/extract_pdf.py uv run --with pymupdf PDF → structure.json + images/ + page renders
scripts/build_html.py uv run --with Pillow structure.json (+ optional translation/captions) → single-file HTML
scripts/verify_render.py uv run --with Pillow --with numpy headless-Chrome render → readable PNG segments

Fidelity (read before translating)

The deliverable looks authoritative, so wrong content is worse than ugly content. The non-negotiable rules — and the specific ways this has gone wrong before — are in references/failure_cases.md. The one that bites hardest: never give a real person an inferred translated name, and copy every number/proper-noun verbatim (failure_cases #6). Read that file before any translation run; skim it before any run.

Next Step

After producing the HTML, suggest the natural follow-up:

Conversion complete: output.html (single self-contained file).

Options:
A) Make a PDF of it — run /daymade-docs:pdf-creator if you want a print/share copy (Recommended if they need to send it)
B) Extract the text as Markdown instead — run /daymade-docs:doc-to-markdown (if they wanted editable text, not a reading page)
C) No thanks — the HTML is what I wanted

支付改造 / Alipay AI usage-based payment

付费调用契约 / Paid invocation contract

Header 名称 / Header names:Payment-Needed Header;支付后使用 Payment-Proof Header。 / Use the Payment-Needed Header before payment and the Payment-Proof Header after payment.

中文:这是一个 Pay Skill 按调用收费技能,不是普通免费 Skill。业务端点在缺少有效付款凭证时必须返回 HTTP 402 Payment Required,并在 Payment-Needed Header 中给出本次调用的账单信息。调用方通过平台提供的 @alipay/agent-payment 完成支付宝 AI 按量付费后获得 Payment-Proof,随后携带 Payment-Proof 重试同一业务请求;x-proof 仅作为兼容转发字段,不替代官方请求头。

English: This is a Pay Skill with usage-based billing, not a free Skill. When a valid payment proof is missing, the business endpoint must return HTTP 402 Payment Required with the bill in the Payment-Needed Header. The caller completes Alipay AI usage-based payment through @alipay/agent-payment, receives a Payment-Proof, and retries the same business request with the official Payment-Proof Header; x-proof may be accepted only as a compatibility forwarding field.

标准流程 / Standard flow

  1. probe / detect:先发送未付款请求;收到 402 和 Payment-Needed Header 后读取金额、币种、商品、资源和有效期。 / Send an unpaid request first; on 402 and the Payment-Needed Header, read amount, currency, product, resource, and expiry.
  2. pay:由宿主调用 @alipay/agent-payment 完成支付宝 AI 按量付费并取得 Payment-Proof。支付宝官方辅助接入命令为 npx -y @alipay/alipay-aipay@latest install,它用于改造和联调服务端,不把密钥写进 Skill。 / The host performs pay through @alipay/agent-payment and obtains a Payment-Proof. Alipay's official assisted-integration command is npx -y @alipay/alipay-aipay@latest install; it helps adapt and test the server without putting secrets in the Skill.
  3. complete:用官方 Payment-Proof Header 重试;业务服务调用 alipay.aipay.agent.payment.verify 校验 active、金额、订单号、资源 ID 和防重复履约状态,验证通过后执行技能并返回 200 与结果。 / Retry with the official Payment-Proof Header; the service calls alipay.aipay.agent.payment.verify, checks active, amount, order, resource ID, and replay protection, then runs the Skill and returns 200 with the result.
  4. ack:返回资源后异步调用 alipay.aipay.agent.fulfillment.confirm 发送履约回执,并保存 receipt 与幂等状态;相同的 idempotency-key 不得重复扣费或重复执行。 / After returning the resource, asynchronously call alipay.aipay.agent.fulfillment.confirm for the fulfillment receipt and persist the receipt and idempotency state; the same idempotency-key must never charge or execute twice.

部署边界 / Deployment boundary

真实收费的业务端点必须由服务提供方独立部署在公网 HTTPS 上,并在服务端校验支付凭证;支付宝密钥、账号凭证和生产环境密钥不得写入 Skill ZIP。沙箱凭证只用于联调,不代表生产收款已经开通。 / The billable business endpoint must be independently deployed on public HTTPS and verify payment proofs server-side; Alipay secrets, account credentials, and production keys must not be put in the Skill ZIP. Sandbox proofs are for integration testing only and do not mean production collection is enabled.

Current listing version

1.0.2

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供本地 PDF 转 HTML 的完整工作流,解决用户将 PDF 转换为可读网页的实际需求
  • 支持翻译功能并保持图表位置,增强实用性
  • 明确区分与 doc-to-markdown、pdf-creator 等工具的边界,定位清晰
Trigger Precision92/100

Highlights

  • description 明确说明使用本地工具完成 PDF 转 HTML,不依赖账号或云端服务
  • 触发词清晰完整,边界明确,无歧义
Structure and Standards95/100

Areas to improve

  • 缺少 When to Use 独立章节 Reported severity: Minor

    When to Use 内容已融入正文,但未作为独立章节突出显示

    Recommendation: 建议将 When to Use / not use 部分提取为独立章节,提升可读性

  • 文档较长 Reported severity: Minor

    文档内容详尽但篇幅较长,可能影响快速浏览

    Recommendation: 可考虑添加目录或摘要卡片,帮助用户快速定位关键信息

Highlights

  • 文档结构完整,包含交付说明、使用场景、限制、依赖、详细工作流、脚本说明、保真度说明、后续建议等
  • frontmatter 完整,包含名称、描述、版本、许可证等元数据
  • 工作流步骤清晰(6 步骤),每个步骤都有详细说明和命令示例
Execution Reliability90/100

Highlights

  • 工具来源明确(uv, PyMuPDF, Pillow, numpy, Chrome),参数正确
  • 覆盖主要异常情况(如装饰性图像识别、表格处理限制、视觉验证)
  • 不可逆操作有确认机制(verify_render.py 强制视觉检查),确保输出质量
  • 提供 failure_cases.md 参考,帮助用户避免常见错误
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.