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