opendataloader-project / opendataloader-pdf

opendataloader-project / opendataloader-pdf

OpenDataLoader PDF is a PDF parser designed for AI-ready data. It automates PDF accessibility and is open-source. 🔍 This PDF parser is built for AI data extraction—allowing you to extract Markdown, JSON (with bounding boxes), and HTML from any PDF. It ranks #1 in benchmarks (0.907 overall) and features a deterministic local mode alongside an AI hybrid mode for complex pages. OpenDataLoader PDF 是一款专为 AI 数据准备的 PDF 解析器。它能实现 PDF 无障碍处理自动化,且完全开源。🔍 该解析器专为 AI 数据提取而生,可从任何 PDF 中提取 Markdown、JSON(含边界框)和 HTML。它在基准测试中排名第一(综合得分 0.907),并提供确定性本地模式以及针对复杂页面的 AI 混合模式。

How accurate is it? — #1 in benchmarks: 0.907 overall, 0.928 table accuracy across 200 real-world PDFs, including multi-column and scientific papers. It uses a deterministic local mode + AI hybrid mode for complex pages. 准确度如何?— 在基准测试中排名第一:综合得分 0.907,在涵盖多栏排版和科学论文的 200 份真实 PDF 文档中,表格识别准确率达到 0.928。它通过确定性本地模式与 AI 混合模式处理复杂页面。

Scanned PDFs and OCR? — Yes. It features built-in OCR (80+ languages) in hybrid mode and works with poor-quality scans at 300 DPI+ (in hybrid mode). 扫描版 PDF 和 OCR?— 支持。混合模式内置 OCR(支持 80 多种语言),并可在混合模式下处理 300 DPI 以上的低质量扫描件。

Tables, formulas, images, charts? — Yes. It handles complex/borderless tables, LaTeX formulas, and AI-generated picture/chart descriptions, all via hybrid mode. 表格、公式、图像和图表?— 支持。通过混合模式,可处理复杂/无边框表格、LaTeX 公式以及 AI 生成的图片/图表描述。

How do I use this for RAG? — pip install opendataloader-pdf, convert in 3 lines. It outputs structured Markdown for chunking, JSON with bounding boxes for source citations, and HTML. LangChain integration is available. Python, Node.js, and Java SDKs are provided. 如何将其用于 RAG?— 执行 pip install opendataloader-pdf,仅需 3 行代码即可完成转换。它输出用于分块的结构化 Markdown、用于源引用的带边界框 JSON 以及 HTML。支持 LangChain 集成,并提供 Python、Node.js 和 Java SDK。

♿ PDF accessibility automation — Auto-tag untagged PDFs into screen-reader-ready Tagged PDFs at scale. It is the first open-source tool to generate Tagged PDFs end-to-end. ♿ PDF 无障碍自动化 — 可大规模将无标签 PDF 自动转换为适配屏幕阅读器的“标签化 PDF”(Tagged PDF)。这是首个实现端到端生成标签化 PDF 的开源工具。

What’s the problem? — Accessibility regulations are now enforced worldwide. Manual PDF remediation costs $50–200 per document and doesn’t scale. 存在什么问题?— 全球范围内无障碍法规正在强制执行。手动修复 PDF 的成本高达每份文档 50–200 美元,且无法规模化。

What’s free? — Layout analysis + auto-tagging (Apache 2.0). Untagged PDF in → Tagged PDF out. No proprietary SDK dependency. 哪些功能免费?— 版面分析 + 自动打标签(基于 Apache 2.0 协议)。输入无标签 PDF,输出标签化 PDF,无需依赖任何专有 SDK。

What about PDF/UA compliance? — Converting Tagged PDF to PDF/UA-1 or PDF/UA-2 is an enterprise add-on. Auto-tagging generates the Tagged PDF; PDF/UA export is the final step. 关于 PDF/UA 合规性?— 将标签化 PDF 转换为 PDF/UA-1 或 PDF/UA-2 属于企业级附加功能。自动打标签生成的是标签化 PDF,而 PDF/UA 导出是流程的最后一步。

Why trust this? — Built in collaboration with Dual Lab (veraPDF developers) based on PDF Association specifications, best practice guides, and the expertise of the PDF Community. Auto-tagging follows the Well-Tagged PDF specification, validated with veraPDF. 为何值得信赖?— 本项目与 Dual Lab(veraPDF 开发商)合作开发,基于 PDF 协会规范、最佳实践指南以及 PDF 社区的专业知识。自动打标签功能遵循“良好标签 PDF”(Well-Tagged PDF)规范,并经由 veraPDF 验证。

Get Started in 30 Seconds

30 秒快速上手

Requires: Java 11+ and Python 3.10+ (Node.js | Java also available). 要求:Java 11+ 和 Python 3.10+(同时提供 Node.js 和 Java 版本)。

Before you start: run java -version. If not found, install JDK 11+ from Adoptium. 开始前:运行 java -version。如果未找到,请从 Adoptium 安装 JDK 11+。

pip install -U opendataloader-pdf
import opendataloader_pdf
# Batch all files in one call — each convert() spawns a JVM process, so repeated calls are slow
opendataloader_pdf.convert(
    input_path=["file1.pdf", "file2.pdf", "folder/"],
    output_dir="output/",
    format="markdown,json"
)

Annotated PDF output — each element (heading, paragraph, table, image) is detected with bounding boxes and semantic type. 带标注的 PDF 输出 — 每个元素(标题、段落、表格、图像)均通过边界框和语义类型进行检测。

What Problems Does This Solve?

它解决了哪些问题?

ProblemSolutionStatus
PDF structure lost during parsing (wrong reading order, broken tables, no coordinates)Deterministic local PDF to Markdown/JSON with bounding boxes, XY-Cut++ reading orderShipped
Complex tables, scanned PDFs, formulas, charts need AI-level understandingHybrid mode routes complex pages to AI backend (#1 in benchmarks)Shipped
Manual PDF remediation cost (Accessibility regulations like EAA, ADA, Section 508)Auto-tag untagged PDFs into Tagged PDFs (free, Apache 2.0). Foundation for PDF/UA workflowsAuto-tag: Shipped. PDF/UA export: Enterprise
问题解决方案状态
解析过程中 PDF 结构丢失(阅读顺序错误、表格损坏、无坐标)确定性本地 PDF 转 Markdown/JSON(含边界框),采用 XY-Cut++ 阅读顺序已发布
复杂表格、扫描版 PDF、公式、图表需要 AI 级理解混合模式将复杂页面路由至 AI 后端(基准测试排名第一)已发布
手动修复 PDF 成本高(EAA、ADA、Section 508 等无障碍法规要求)将无标签 PDF 自动转换为标签化 PDF(免费,Apache 2.0)。为 PDF/UA 工作流奠定基础自动打标签:已发布;PDF/UA 导出:企业版

Capability Matrix

功能矩阵

CapabilitySupportedTier
Data extraction (text with correct reading order)YesFree
Bounding boxes for every elementYesFree
Table extraction (simple borders)YesFree
Table extraction (complex/borderless)YesFree (Hybrid)
Heading hierarchy detectionYesFree
List detection (numbered, bulleted, nested)YesFree
Image extraction with coordinatesYesFree
AI chart/image descriptionYesFree (Hybrid)
OCR for scanned PDFsYesFree (Hybrid)
Formula extraction (LaTeX)YesFree (Hybrid)
Tagged PDF structure extractionYesFree
AI safety (prompt injection filtering)YesFree
Header/footer/watermark filteringYesFree
Accessibility (Auto-tagging)YesFree (Apache 2.0)
PDF/UA-1, PDF/UA-2 export💼Available Enterprise
功能支持等级
数据提取(带正确阅读顺序的文本)免费
每个元素的边界框免费
表格提取(简单边框)免费
表格提取(复杂/无边框)免费(混合模式)
标题层级检测免费
列表检测(编号、项目符号、嵌套)免费
带坐标的图像提取免费
AI 图表/图像描述免费(混合模式)
扫描版 PDF 的 OCR免费(混合模式)
公式提取 (LaTeX)免费(混合模式)
标签化 PDF 结构提取免费
AI 安全(提示词注入过滤)免费
页眉/页脚/水印过滤免费
无障碍(自动打标签)免费(Apache 2.0)
PDF/UA-1, PDF/UA-2 导出💼企业版可用

Extraction Benchmarks

提取基准测试

opendataloader-pdf [hybrid] ranks #1 overall (0.907) across reading order, table, and heading extraction accuracy. opendataloader-pdf [混合模式] 在阅读顺序、表格和标题提取准确率方面综合排名第一 (0.907)。

(Note: The original table data is provided in the source text; please refer to the provided benchmark table for specific engine comparisons.) (注:原文提供了详细的基准测试表格,请参考原文中的数据进行各引擎对比。)

Which Mode Should I Use?

我应该使用哪种模式?

Your DocumentModeInstallServer CommandClient Command
Standard digital PDFFast (default)pip install opendataloader-pdfNone neededopendataloader-pdf file1.pdf ...
Complex/nested tablesHybridpip install "opendataloader-pdf[hybrid]"opendataloader-pdf-hybrid --port 5002opendataloader-pdf --hybrid ...
Scanned/image-based PDFHybrid + OCRpip install "opendataloader-pdf[hybrid]"... --force-ocropendataloader-pdf --hybrid ...
您的文档类型模式安装命令服务端命令客户端命令
标准数字 PDF快速(默认)pip install opendataloader-pdf无需opendataloader-pdf file1.pdf ...
复杂/嵌套表格混合pip install "opendataloader-pdf[hybrid]"opendataloader-pdf-hybrid --port 5002opendataloader-pdf --hybrid ...
扫描/图像 PDF混合 + OCRpip install "opendataloader-pdf[hybrid]"... --force-ocropendataloader-pdf --hybrid ...