OpenSource-Hub

opendataloader-pdf

라이브러리

opendataloader-project/opendataloader-pdf

AI 데이터 추출 및 접근성을 위한 PDF 파서.

개요

오픈소스 PDF 파서, 구조화된 데이터(Markdown, JSON, HTML) 추출, 경계 상자, 읽기 순서 및 테이블 지원 포함. 태그가 없는 PDF를 자동으로 태그된 PDF로 변환하여 접근성 향상, 선택적 기업용 PDF/UA 내보내기 가능. 추출 정확도 벤치마크에서 1위.

README 미리보기

\n\n# OpenDataLoader PDF\n\n**PDF Parser for AI-ready data. Automate PDF accessibility. Open-source.**\n\n[](https://github.com/opendataloader-project/opendataloader-pdf/blob/main/LICENSE)\n[](https://pypi.org/project/opendataloader-pdf/)\n[](https://www.npmjs.com/package/@opendataloader/pdf)\n[](https://search.maven.org/artifact/org.opendataloader/opendataloader-pdf-core)\n[](https://github.com/opendataloader-project/opendataloader-pdf#java)\n\n\n\n🔍 **PDF parser for AI data extraction** — Extract Markdown, JSON (with bounding boxes), and HTML from any PDF. #1 in benchmarks (0.907 overall). Deterministic local mode + AI hybrid mode for complex pages.\n\n- **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. Deterministic local mode + AI hybrid mode for complex pages ([benchmarks](#extraction-benchmarks))\n- **Scanned PDFs and OCR?** — Yes. Built-in OCR (80+ languages) in hybrid mode. Works with poor-quality scans at 300 DPI+ ([hybrid mode](#hybrid-mode-1-accuracy-for-complex-pdfs))\n- **Tables, formulas, images, charts?** — Yes. Complex/borderless tables, LaTeX formulas, and AI-generated picture/chart descriptions all via hybrid mode ([hybrid mode](#hybrid-mode-1-accuracy-for-complex-pdfs))\n- **How do I use this for RAG?** — `pip install opendataloader-pdf`, convert in 3 lines. Outputs structured Markdown for chunking, JSON with bounding boxes for source citations, and HTML. LangChain integration available. Python, Node.js, Java SDKs ([quick start](#get-started-in-30-seconds) | [LangChain](#langchain-integration))\n\n♿ **PDF accessibility automation** — Auto-tag untagged PDFs into screen-reader-ready Tagged PDFs at scale. First open-source tool to generate Tagged PDFs end-to-end.\n\n- **What's the problem?** — Accessibility regulations are now enforced worldwide. Manual PDF remediation costs $50–200 per document and doesn't scale ([regulations](#pdf-accessibility--

FAQ (5)

문제 해결
opendataloader-pdf가 --quiet 플래그를 사용하지 않을 때 출력이 두 번 출력되는 이유는 무엇인가요?

버그로 인해 --quiet 옵션이 설정되지 않았을 때 stdout 출력이 중복됩니다. 이 수정 사항은 CLI가 이중으로 쓰지 않도록 스트리밍 모드에서 promise를 빈 문자열로 해결합니다. 최신 버전의 opendataloader-pdf로 업데이트하거나 PR #399의 변경 사항을 수동으로 적용하십시오: src/index.ts의 executeJar 함수에서 resolve 호출을 resolve(streamOutput ? '' : stdout)로 변경하십시오.

원본 Issue #398
문제 해결
OpenDataLoaderPDF.processFile 이후에 PDF를 삭제하려고 하면 'The file cannot be deleted because it is being used by another process' 오류가 발생하는 이유는 무엇인가요?

OpenDataLoader 2.2.1에서 PDF PDDocument와 관련 리소스가 처리 후 제대로 닫히지 않아 활성 파일 잠금이 남습니다. 이 문제를 해결하려면 리소스 정리 메서드를 추가하고 기존 processFile 로직을 try-finally 블록으로 감싸세요. DocumentProcessor.java에 다음을 구현하세요:

// Add this method
private static void closePdfResources() {
    try {
        StaticLayoutContainers.closeContrastRatioConsumer();
    } catch (Exception e) {
        LOGGER.log(Level.WARNING, "Unable to close contrast ratio consumer: " + e.getMessage());
    }
    PDDocument document = StaticResources.getDocument();
    if (document != null) {
        try {
            document.close();
        } catch (Exception e) {
            LOGGER.log(Level.WARNING, "Unable to close PDF document: " + e.getMessage());
        }
    }
}

// Wrap processFile body in try-finally
public static void processFile(String inputPdfName, Config config) throws IOException {
    try {
        // ... original code ...
    } finally {
        closePdfResources();
    }
}

이 수정을 적용하면 처리 후 파일을 즉시 삭제할 수 있습니다.

원본 Issue #408
문제 해결
원본 PDF 파일명에 공백이 있을 때 생성된 markdown에서 이미지가 표시되지 않는 이유는 무엇인가요?

마크다운 변환기가 이스케이프되지 않은 공백이 있는 이미지 링크를 생성하여, 렌더러가 첫 번째 공백에서 경로를 잘라버립니다 (예: ![image](my paper_images/image.png)). 이를 수정하려면 이미지 경로를 꺾쇠괄호로 감싸주세요: ![image](<my paper_images/image.png>). 이는 CommonMark §6.4를 준수하며 VS Code, GitHub 및 대부분의 렌더러에서 이미지가 올바르게 렌더링되도록 보장합니다. 이 수정 사항은 커밋 4b87a30 (PR #468)에 포함되었습니다.

원본 Issue #405
문제 해결
opendataloader_pdf를 사용하여 PDF를 변환할 때 'subprocess.CalledProcessError: returned non-zero exit status 1' 오류를 수정하는 방법은 무엇인가요?

이 오류는 특정 PDF(예: QuarkXPress로 생성된 파일)를 처리할 때 이미지 추출 로직의 버그로 인해 발생합니다. 이 버그는 최신 릴리스에서 수정되었습니다. pip을 사용하여 opendataloader_pdf를 최신 버전(v2.0.3 이상)으로 업그레이드하세요: pip install --upgrade opendataloader_pdf.

원본 Issue #394
문제 해결
numpy >= 2.0을 docling 또는 hybrid libraries와 함께 사용할 때 오류가 발생하는 이유는 무엇인가요?

이 프로젝트는 이미 numpy >= 2.0을 네이티브로 지원합니다 (lockfiles에서 numpy 2.2.6/2.4.2로 확인됨). 오류가 발생한다면, 이전에 numpy < 2로 고정되었던 docling 또는 easyocr과 같은 전이 종속성의 오래된 설치 때문일 가능성이 높습니다. 해결하려면 처음부터 다시 설치하십시오: pip install --upgrade --force-reinstall docling 또는 pip install --no-cache-dir docling[easyocr]. 모든 패키지가 업데이트되었는지 확인하십시오. 문제가 지속되면 pip list로 해결된 종속성 버전을 확인하고 traceback, Python 버전 및 설치 방법을 보고하십시오.

원본 Issue #330