name: pdf-process-mineru description: PDF document parsing tool based on local MinerU, supports converting PDF to Markdown, JSON, and other machine-readable formats.
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}}'
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"}}'
# Update pip and install uv
pip install --upgrade pip
pip install uv
# Install MinerU (including all features)
uv pip install -U "mineru[all]"
# Check if MinerU is installed successfully
mineru --version
# Test basic functionality
mineru --help
pipeline backend: minimum 16GB, recommended 32GB+hybrid/vlm backend: minimum 16GB, recommended 32GB+pipeline backend: supports CPU-onlyhybrid/vlm backend: requires NVIDIA GPU (Volta architecture and above) or Apple Silicon发现更多技能插件,请访问7w4.net。
Using uv pip install can resolve most dependency conflicts
Insufficient Memory:
pipeline backendstart_page and end_pageReduce virtual memory allocation
Slow Parsing Speed:
hybrid-auto-engine backendDisable unnecessary features (formulas, tables)
Low OCR Accuracy:
pipeline or hybrid-*)这是一个功能完整的 PDF 解析工具,能够将 PDF 转换为 Markdown 或 JSON 格式,保留文档结构、公式和表格。文档详细,安装脚本考虑了版本兼容性,使用起来比较顺手。主要不足是文档有中英文重复内容,解析器默认强制使用 CPU 模式,在有 GPU 的环境下可能无法发挥最佳性能。整体质量良好,适合需要处理学术论文或技术文档的用户使用。