# Mineru Pdf

> >

- **Type:** Skill
- **Install:** `agentstack add skill-hawkongz-mineru-pdf-zh-cn`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [hawkongz](https://agentstack.voostack.com/s/hawkongz)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [hawkongz](https://github.com/hawkongz)
- **Source:** https://github.com/hawkongz/mineru-pdf/tree/master/zh-CN

## Install

```sh
agentstack add skill-hawkongz-mineru-pdf-zh-cn
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MinerU PDF 内容提取

## 概述

[MinerU](https://github.com/opendatalab/MinerU) 是一个文档解析引擎，能处理 pypdf/pdfplumber 无法胜任的场景：数学公式、多栏排版的阅读顺序、带位置元数据的图片提取、扫描件 OCR。完全本地运行（无需 API Key，模型下载后无需网络）。

本 skill 仅用于**内容提取**。PDF 编辑操作（合并、拆分、旋转、水印、加密、表单）请使用标准 pdf skill。

## 工作流程

### 1. 检查安装

```bash
pip show mineru
```

如未安装：
```bash
pip install "mineru[pipeline]"
```

首次运行会自动下载模型（~2 GB）。如果 HuggingFace 下载慢或被墙，切换到 ModelScope（国内镜像）：
```bash
export MINERU_MODEL_SOURCE=modelscope   # macOS / Linux
$env:MINERU_MODEL_SOURCE="modelscope"   # Windows PowerShell
```
设为 ModelScope 后从 `modelscope.cn` 下载，国内速度快很多。这个环境变量只需在首次运行前设置一次。

### 2. 运行 MinerU

```bash
mineru -p "文件路径" -o "输出目录/" -b pipeline
```

关键选项（按需向用户说明）：

| 参数 | 使用场景 |
|:---|:---|
| `-l en` | 非中文文档（默认 `ch`） |
| `-f False` | 无公式时跳过公式识别，节省时间 |
| `-t False` | 无表格时跳过表格识别 |
| `-s N -e M` | 只处理指定页码范围 |

### 3. 报告结果

提取完成后，向用户总结：

- 处理了多少页
- 输出目录和关键文件
- 提取到的图片、公式、表格数量
- 标注任何异常（空页、缺失内容等）

## 输出结构

```
输出目录//auto/
├── .md                  # 结构化 Markdown
├── _content_list.json   # 元素元数据
├── _model.json          # 版面检测结果
├── _middle.json         # 中间处理数据
└── images/                      # 提取的图片（JPG）
```

Markdown 保留了文档结构（标题层级、阅读顺序、图片引用）。JSON 提供每个元素的 `type`、`bbox`、`page_idx` 和 `text`，方便下游处理。

## 性能参考

首次运行从 HuggingFace 下载模型（~2 GB），永久缓存。后续运行跳过此步骤。

| PDF 类型 | 约需时间 |
|:---|:---|
| 10 页纯文字 | 1 分钟 |
| 7 页学术论文（公式 + 图片） | 3 分钟 |
| 30 页扫描章节 | 10-15 分钟 |

纯 CPU 环境也可运行，但较慢。GPU 可显著加速版面检测和公式识别。

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [hawkongz](https://github.com/hawkongz)
- **Source:** [hawkongz/mineru-pdf](https://github.com/hawkongz/mineru-pdf)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-hawkongz-mineru-pdf-zh-cn
- Seller: https://agentstack.voostack.com/s/hawkongz
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
