Tool List
1. pdf_to_markdown
Convert PDF documents to Markdown format, preserving document structure, formulas, tables, and images.
Description: Use MinerU to parse PDF documents and output in Markdown format, supporting OCR, formula recognition, table extraction, and other features.
Parameters:
file_path (string, required): Absolute path to the PDF file
output_dir (string, required): Absolute path to the output directory
backend (string, optional): Parsing backend, options: hybrid-auto-engine (default), pipeline, vlm-auto-engine
language (string, optional): OCR language code, such as en (English), ch (Chinese), ja (Japanese), etc., defaults to auto-detection
enable_formula (boolean, optional): Whether to enable formula recognition, defaults to true
enable_table (boolean, optional): Whether to enable table extraction, defaults to true
start_page (integer, optional): Start page number (starting from 0), defaults to 0
end_page (integer, optional): End page number (starting from 0), defaults to -1 meaning parse all pages
Return Value:
{
"success": true,
"output_path": "/path/to/output",
"markdown_content": "Converted Markdown content...",
"images": ["List of image paths"],
"tables": ["List of table information"],
"formula_count": 10
}
Examples:
python .claude/skills/pdf-process/script/pdf_parser.py \
'{"name": "pdf_to_markdown", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output"}}'
# Use specific backend
python .claude/skills/pdf-process/script/pdf_parser.py \
'{"name": "pdf_to_markdown", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output", "backend": "pipeline"}}'
# Parse specific pages
python .claude/skills/pdf-process/script/pdf_parser.py \
'{"name": "pdf_to_markdown", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output", "start_page": 0, "end_page": 5}}'
2. pdf_to_json
Convert PDF documents to JSON format, including detailed layout and structural information.
Description: Use MinerU to parse PDF documents and output in JSON format, containing structured information such as text blocks, images, tables, formulas, etc.
Parameters:
file_path (string, required): Absolute path to the PDF file
output_dir (string, required): Absolute path to the output directory
backend (string, optional): Parsing backend, options: hybrid-auto-engine (default), pipeline, vlm-auto-engine
language (string, optional): OCR language code, such as en (English), ch (Chinese), ja (Japanese), etc., defaults to auto-detection
enable_formula (boolean, optional): Whether to enable formula recognition, defaults to true
enable_table (boolean, optional): Whether to enable table extraction, defaults to true
start_page (integer, optional): Start page number (starting from 0), defaults to 0
end_page (integer, optional): End page number (starting from 0), defaults to -1 meaning parse all pages
Return Value:
{
"success": true,
"output_path": "/path/to/output.json",
"pages": [
{
"page_no": 0,
"page_size": [595, 842],
"blocks": [
{
"type": "text",
"text": "Text content",
"bbox": [x, y, x, y]
}
],
"images": [],
"tables": [],
"formulas": []
}
],
"metadata": {
"total_pages": 10,
"author": "Author",
"title": "Title"
}
}
Examples:
python .claude/skills/pdf-process/script/pdf_parser.py \
'{"name": "pdf_to_json", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output"}}'
# Use specific backend and language
python .claude/skills/pdf-process/script/pdf_parser.py \
'{"name": "pdf_to_json", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output", "backend": "hybrid-auto-engine", "language": "ch"}}'
Installation Instructions
1. Install MinerU
# Update pip and install uv
pip install --upgrade pip
pip install uv
# Install MinerU (including all features)
uv pip install -U "mineru[all]"
2. Verify Installation
# Check if MinerU is installed successfully
mineru --version
# Test basic functionality
mineru --help
3. System Requirements
- Python Version: 3.10-3.13
- Operating System: Linux / Windows / macOS 14.0+
- Memory:
- Using
pipeline backend: minimum 16GB, recommended 32GB+
- Using
hybrid/vlm backend: minimum 16GB, recommended 32GB+
- Disk Space: minimum 20GB (SSD recommended)
- GPU (optional):
pipeline backend: supports CPU-only
hybrid/vlm backend: requires NVIDIA GPU (Volta architecture and above) or Apple Silicon
Use Cases
- Academic Paper Parsing: Extract structured content such as formulas, tables, and images
- Technical Document Conversion: Convert PDF documents to Markdown for version control and online publishing
- OCR Processing: Process scanned PDFs and garbled PDFs
- Multilingual Documents: Supports OCR recognition for 109 languages
- Batch Processing: Batch convert multiple PDF documents
Backend Selection Recommendations
- hybrid-auto-engine (default): Balanced accuracy and speed, suitable for most scenarios
- pipeline: Suitable for CPU-only environments, best compatibility
- vlm-auto-engine: Highest accuracy, requires GPU acceleration
Notes
- File Paths: All paths must be absolute paths
- Output Directory: Non-existent directories will be created automatically
- Performance: Using GPU can significantly improve parsing speed
- Page Numbers: Page numbers start counting from 0
- Memory: Processing large documents may consume more memory
Troubleshooting
Common Issues
Installation Failure:
- Ensure using Python 3.10-3.13
- Windows only supports Python 3.10-3.12 (ray does not support 3.13)
- Using
uv pip install can resolve most dependency conflicts
Insufficient Memory:
- Use
pipeline backend
- Limit parsing pages:
start_page and end_page
- Reduce virtual memory allocation
Slow Parsing Speed:
- Enable GPU acceleration
- Use
hybrid-auto-engine backend
- Disable unnecessary features (formulas, tables)
Low OCR Accuracy:
- Specify the correct document language
- Ensure the backend supports OCR (use
pipeline or hybrid-*)
Related Resources
1---2name: pdf-process-mineru3description: PDF document parsing tool based on local MinerU, supports converting PDF to Markdown, JSON, and other machine-readable formats.4---5
6## Tool List
7
8### 1. pdf_to_markdown
9
10Convert PDF documents to Markdown format, preserving document structure, formulas, tables, and images.
11
12**Description**: Use MinerU to parse PDF documents and output in Markdown format, supporting OCR, formula recognition, table extraction, and other features.
13
14**Parameters**:
15- `file_path` (string, required): Absolute path to the PDF file
16- `output_dir` (string, required): Absolute path to the output directory
17- `backend` (string, optional): Parsing backend, options: `hybrid-auto-engine` (default), `pipeline`, `vlm-auto-engine`
18- `language` (string, optional): OCR language code, such as `en` (English), `ch` (Chinese), `ja` (Japanese), etc., defaults to auto-detection
19- `enable_formula` (boolean, optional): Whether to enable formula recognition, defaults to true
20- `enable_table` (boolean, optional): Whether to enable table extraction, defaults to true
21- `start_page` (integer, optional): Start page number (starting from 0), defaults to 0
22- `end_page` (integer, optional): End page number (starting from 0), defaults to -1 meaning parse all pages
23
24**Return Value**:
25```json
26{
27 "success": true,
28 "output_path": "/path/to/output",
29 "markdown_content": "Converted Markdown content...",
30 "images": ["List of image paths"],
31 "tables": ["List of table information"],
32 "formula_count": 10
33}
34```
35
36**Examples**:
37```bash
38python .claude/skills/pdf-process/script/pdf_parser.py \
39 '{"name": "pdf_to_markdown", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output"}}'
40
41# Use specific backend
42python .claude/skills/pdf-process/script/pdf_parser.py \
43 '{"name": "pdf_to_markdown", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output", "backend": "pipeline"}}'
44
45# Parse specific pages
46python .claude/skills/pdf-process/script/pdf_parser.py \
47 '{"name": "pdf_to_markdown", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output", "start_page": 0, "end_page": 5}}'
48```
49
50---
51
52### 2. pdf_to_json
53
54Convert PDF documents to JSON format, including detailed layout and structural information.
55
56**Description**: Use MinerU to parse PDF documents and output in JSON format, containing structured information such as text blocks, images, tables, formulas, etc.
57
58**Parameters**:
59- `file_path` (string, required): Absolute path to the PDF file
60- `output_dir` (string, required): Absolute path to the output directory
61- `backend` (string, optional): Parsing backend, options: `hybrid-auto-engine` (default), `pipeline`, `vlm-auto-engine`
62- `language` (string, optional): OCR language code, such as `en` (English), `ch` (Chinese), `ja` (Japanese), etc., defaults to auto-detection
63- `enable_formula` (boolean, optional): Whether to enable formula recognition, defaults to true
64- `enable_table` (boolean, optional): Whether to enable table extraction, defaults to true
65- `start_page` (integer, optional): Start page number (starting from 0), defaults to 0
66- `end_page` (integer, optional): End page number (starting from 0), defaults to -1 meaning parse all pages
67
68**Return Value**:
69```json
70{
71 "success": true,
72 "output_path": "/path/to/output.json",
73 "pages": [
74 {
75 "page_no": 0,
76 "page_size": [595, 842],
77 "blocks": [
78 {
79 "type": "text",
80 "text": "Text content",
81 "bbox": [x, y, x, y]
82 }
83 ],
84 "images": [],
85 "tables": [],
86 "formulas": []
87 }
88 ],
89 "metadata": {
90 "total_pages": 10,
91 "author": "Author",
92 "title": "Title"
93 }
94}
95```
96
97**Examples**:
98```bash
99python .claude/skills/pdf-process/script/pdf_parser.py \
100 '{"name": "pdf_to_json", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output"}}'
101
102# Use specific backend and language
103python .claude/skills/pdf-process/script/pdf_parser.py \
104 '{"name": "pdf_to_json", "arguments": {"file_path": "/path/to/document.pdf", "output_dir": "/path/to/output", "backend": "hybrid-auto-engine", "language": "ch"}}'
105```
106
107---
108
109## Installation Instructions
110
111### 1. Install MinerU
112
113```bash
114# Update pip and install uv
115pip install --upgrade pip
116pip install uv
117
118# Install MinerU (including all features)
119uv pip install -U "mineru[all]"
120```
121
122### 2. Verify Installation
123
124```bash
125# Check if MinerU is installed successfully
126mineru --version
127
128# Test basic functionality
129mineru --help
130```
131
132### 3. System Requirements
133
134- **Python Version**: 3.10-3.13
135- **Operating System**: Linux / Windows / macOS 14.0+
136- **Memory**:
137 - Using `pipeline` backend: minimum 16GB, recommended 32GB+
138 - Using `hybrid/vlm` backend: minimum 16GB, recommended 32GB+
139- **Disk Space**: minimum 20GB (SSD recommended)
140- **GPU** (optional):
141 - `pipeline` backend: supports CPU-only
142 - `hybrid/vlm` backend: requires NVIDIA GPU (Volta architecture and above) or Apple Silicon
143
144## Use Cases
145
1461. **Academic Paper Parsing**: Extract structured content such as formulas, tables, and images
1472. **Technical Document Conversion**: Convert PDF documents to Markdown for version control and online publishing
1483. **OCR Processing**: Process scanned PDFs and garbled PDFs
1494. **Multilingual Documents**: Supports OCR recognition for 109 languages
1505. **Batch Processing**: Batch convert multiple PDF documents
151
152## Backend Selection Recommendations
153
154- **hybrid-auto-engine** (default): Balanced accuracy and speed, suitable for most scenarios
155- **pipeline**: Suitable for CPU-only environments, best compatibility
156- **vlm-auto-engine**: Highest accuracy, requires GPU acceleration
157
158## Notes
159
1601. **File Paths**: All paths must be absolute paths
1612. **Output Directory**: Non-existent directories will be created automatically
1623. **Performance**: Using GPU can significantly improve parsing speed
1634. **Page Numbers**: Page numbers start counting from 0
1645. **Memory**: Processing large documents may consume more memory
165
166## Troubleshooting
167
168### Common Issues
169
1701. **Installation Failure**:
171 - Ensure using Python 3.10-3.13
172 - Windows only supports Python 3.10-3.12 (ray does not support 3.13)
173 - Using `uv pip install` can resolve most dependency conflicts
174
1752. **Insufficient Memory**:
176 - Use `pipeline` backend
177 - Limit parsing pages: `start_page` and `end_page`
178 - Reduce virtual memory allocation
179
1803. **Slow Parsing Speed**:
181 - Enable GPU acceleration
182 - Use `hybrid-auto-engine` backend
183 - Disable unnecessary features (formulas, tables)
184
1854. **Low OCR Accuracy**:
186 - Specify the correct document language
187 - Ensure the backend supports OCR (use `pipeline` or `hybrid-*`)
188
189## Related Resources
190
191- MinerU Official Documentation: https://opendatalab.github.io/MinerU/
192- MinerU GitHub: https://github.com/opendatalab/MinerU
193- Online Demo: https://mineru.net/