Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

pdf-to-markdownPDF TO Markdown 控制

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

2,668

周安装

109

GitHub Stars

4

下载量

855
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pdf-to-markdown(PDF TO Markdown 控制)
来源仓库:https://github.com/aliceisjustplaying/claude-resources-monorepo
仓库路径:skills/pdf-to-markdown
安装命令:
npx skills add https://github.com/aliceisjustplaying/claude-resources-monorepo --skill pdf-to-markdown
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/aliceisjustplaying/claude-resources-monorepo --skill pdf-to-markdown

简介

pdf-to-markdown 使用 IBM Docling AI 将完整 PDF 转换为结构化 Markdown,保留格式和布局。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要全文分析、总结或讨论文档内容的场景。
  • 支持标题识别、表格提取、代码块和图片处理,确保内容可读性。
  • 安装命令:npx skills add https://github.com/aliceisjustplaying/claude-resources-monorepo --skill pdf-to-markdown。
  • 仅用于内部上下文分析,禁止生成对外公开文案或声称原创性结论。

SKILL.md

PDF to Markdown Converter

Extract complete PDF content as structured Markdown using IBM Docling AI, preserving:

  • Headers (detected by font size, converted to # tags)
  • Bold, italic, monospace formatting
  • Tables (high-accuracy extraction using TableFormer AI model)
  • Lists (ordered and unordered)
  • Multi-column layouts (correct reading order)
  • Code blocks
  • Images (extracted and copied next to output with relative paths)

When to Use This Skill

USE THIS when:

  • User wants the "whole PDF" or "entire document" in context
  • Analyzing, summarizing, or discussing PDF content
  • User says "load", "read", "bring in", "extract" a PDF
  • Grepping/searching would miss context or structure
  • PDF has tables, formatting, or structure to preserve

Environment Setup

This skill uses a dedicated virtual environment at ~/.claude/skills/pdf-to-markdown/.venv/ to avoid polluting the user's working directory.

First-Time Setup (if.venv doesn't exist)

cd ~/.claude/skills/pdf-to-markdown && uv venv .venv && uv pip install --python .venv/bin/python pymupdf docling docling-core

Verify Installation

~/.claude/skills/pdf-to-markdown/.venv/bin/python -c "import pymupdf; import docling; import docling_core; print('OK')"

Quick Start

# Convert PDF to markdown (always extracts images)
~/.claude/skills/pdf-to-markdown/.venv/bin/python ~/.claude/skills/pdf-to-markdown/scripts/pdf_to_md.py document.pdf

# Output: document.md + images/ folder (next to the .md file)

Standard Workflow

When user provides a PDF and wants full content in context:

Step 1: Ensure the skill venv exists

test -d ~/.claude/skills/pdf-to-markdown/.venv || (cd ~/.claude/skills/pdf-to-markdown && uv venv .venv && uv pip install --python .venv/bin/python pymupdf docling docling-core)

Step 2: Convert PDF to Markdown

~/.claude/skills/pdf-to-markdown/.venv/bin/python ~/.claude/skills/pdf-to-markdown/scripts/pdf_to_md.py "/path/to/document.pdf"

Step 3: Read the output

# Output is written to document.md in the same directory as the PDF
cat /path/to/document.md

Caching

PDFs are aggressively cached to avoid re-processing. First extraction is slow (~1 sec/page), every subsequent request is instant.

How It Works

  • Cache location: ~/.cache/pdf-to-markdown/<cache_key>/
  • Cache key: Based on file content hash
  • Invalidation: Cache is invalidated when:

- Source PDF is modified (size or mtime changes) - Extractor version changes (automatic re-extraction) - Explicitly cleared with --clear-cache or --clear-all-cache

Cache Commands

# Clear cache for a specific PDF
~/.claude/skills/pdf-to-markdown/.venv/bin/python ~/.claude/skills/pdf-to-markdown/scripts/pdf_to_md.py document.pdf --clear-cache

# Clear entire cache
~/.claude/skills/pdf-to-markdown/.venv/bin/python ~/.claude/skills/pdf-to-markdown/scripts/pdf_to_md.py --clear-all-cache

# Show cache statistics
~/.claude/skills/pdf-to-markdown/.venv/bin/python ~/.claude/skills/pdf-to-markdown/scripts/pdf_to_md.py --cache-stats

Cache Contents

~/.cache/pdf-to-markdown/<cache_key>/
├── metadata.json    # source path, mtime, size, total_pages
├── full_output.md   # cached full markdown
└── images/          # extracted images

Image Handling

Images are always extracted. They are:

  • Cached in ~/.cache/pdf-to-markdown/<cache_key>/images/
  • Copied to images/ folder next to the output .md file
  • Referenced in the markdown with relative paths (images/filename.png)
  • Summarized in a table at the end of the document

Auto-View Behavior for Images

IMPORTANT: When the extracted markdown contains image references like:

**[Image: figure_1.png (1200x800, 125.3KB)]**

And the user asks about something that might be visual (charts, graphs, diagrams, figures, screenshots, layouts, designs, plots, illustrations), automatically use the Read tool to view the relevant image file(s) before answering. Don't ask the user - just look at it.

Examples of when to auto-view images:

  • User: "What does the chart on page 3 show?" → Read the image file
  • User: "Summarize the figures in this paper" → Read all image files
  • User: "What's in the diagram?" → Read the image file
  • User: "Describe the architecture shown" → Read the image file
  • User: "What are the results?" (and there's a results figure) → Read it

Output Format

The markdown output includes:

Header (metadata)

---
source: document.pdf
total_pages: 42
extracted_at: 2025-01-15T10:30:00
from_cache: true
images_dir: images
---

Content with image references

# Main Title

## Section Header

Regular paragraph text with **bold**, *italic*, and `code` formatting.

![Figure 1](images/figure_1.png)

**[Image: figure_1.png (800x600, 45.2KB)]**

| Column A | Column B |
|----------|----------|
| Data 1   | Data 2   |

Image summary table (at end)

---

## Extracted Images

| # | File | Dimensions | Size |
|---|------|------------|------|
| 1 | figure_1.png | 800x600 | 45.2KB |
| 2 | chart_2.png | 1200x800 | 89.1KB |

Script Reference

Location: ~/.claude/skills/pdf-to-markdown/scripts/pdf_to_md.py

Usage: pdf_to_md.py <input.pdf> [output.md] [options]

Options:
  --no-progress     Disable progress indicator

Cache Options:
  --clear-cache        Clear cache for this PDF and re-extract
  --clear-all-cache    Clear entire cache directory and exit
  --cache-stats        Show cache statistics and exit

Performance

  • First extraction: ~1 second per page (Docling AI processing)
  • First run: Downloads AI models (~500MB one-time)
  • Cached extraction: Instant
  • High-resolution images: 4x default resolution for crisp output

Troubleshooting

"No module named docling" or venv doesn't exist

Recreate the skill's virtual environment:

cd ~/.claude/skills/pdf-to-markdown && rm -rf .venv && uv venv .venv && uv pip install --python .venv/bin/python pymupdf docling docling-core

Poor extraction quality

For scanned PDFs, ensure Tesseract OCR is installed: brew install tesseract

Tables not formatting correctly

This skill uses IBM's TableFormer AI model which has ~93.6% accuracy on complex tables. If tables are still garbled, the PDF may have unusual formatting.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.48%
按下载量换算303

Claude

28.21%
按下载量换算241

Cursor

21.1%
按下载量换算180

Gemini CLI

8.96%
按下载量换算77

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills