The Parse LayerTable, chart and layout extraction

Extracting Tables From Native PDFs vs Scanned Images

Native and scanned PDFs need different extraction methods.

Cover illustration for “Extracting Tables From Native PDFs vs Scanned Images”
  • The common experience: copy a table from a PDF into Excel, watch it scramble; run an extraction script on three files and watch it fail on the next ten
  • The instinct is to blame the tool — but the real variable is what kind of PDF the tool is working on
  • PDF format was designed to preserve visual layout for printing and display, not to encode data structure for programmatic extraction
  • A row that looks clean on screen may be a collection of text fragments placed at specific coordinates with no underlying table object
  • This visual-first, data-second design means the challenge is not reading text — it is reconstructing structure that was never formally encoded
  • The split between document types is where the extraction problem actually starts: native PDFs and scanned PDFs look identical to a human reader but present entirely different problems to software

What separates a native PDF from a scanned one at the technical level

  • Native PDFs: machine-readable text layer preserved from the originating application — typically accounting systems, ERPs, or office exports
  • Scanned PDFs: a raster image of a physical page wrapped in a PDF container — produced by printers, mobile scanning apps, and dedicated document scanners
  • The container looks identical; the contents are fundamentally different — one holds characters with coordinates, the other holds pixels
  • How to tell which you have:
    • Try to highlight and select text in a PDF viewer — if it selects cleanly, the text layer exists
    • If the cursor selects the whole page as an image, it is a scanned document
    • Programmatically: tools like pdfplumber or PyMuPDF return an empty text layer on scanned pages
  • A mixed-type document — some pages native, some scanned — is a real-world complication that breaks pipelines assuming a single document type throughout
  • Origin matters in practice: a supplier who exports invoices digitally sends native PDFs; the same supplier who prints and faxes or scans the same form sends scanned PDFs — the document content is identical, but the extraction problem is not

How native PDF extraction works and where it breaks down

  • Coordinate-based parsing: tools read the text layer directly, inferring table structure from character positions and whitespace gaps — no pixel-to-character conversion needed
  • The three main open-source libraries and their distinct approaches:
    • Tabula: heuristic-based detection using whitespace gaps and character positioning; Lattice mode traces visible grid lines, Stream mode infers columns from gaps — works well on clean digitally-generated PDFs with consistent column alignment
    • Camelot: two modes — Lattice (reliable when borders are present) and Stream (requires manual configuration of column separators and edge tolerances, breaks when layout varies)
    • pdfplumber: character-level access to the coordinate space; fully programmable but every document type requires its own extraction logic — layout drift across vendor invoices or quarterly reports means rewriting rules repeatedly
  • Speed advantage: on Unicode-compatible native PDFs, PyMuPDF processes at 0.007 seconds with 100% accuracy — the benchmark floor for what coordinate parsing achieves on well-formed documents (per arxiv.org/pdf/2407.04577)
  • Four structural features that break coordinate parsers even on native documents:
    • Borderless tables: cell boundaries must be inferred from whitespace that shifts with font size and layout changes
    • Merged cells: spanning multiple columns disrupts uniform grid assumptions and produces misaligned output
    • Multi-page tables: most parsers reset context at each page boundary and cannot reassociate headers
    • Rotated headers or irregular column spans: break left-to-right reading assumptions baked into coordinate logic
  • Practical ceiling: coordinate-based tools are fast and cheap on clean, standardised documents — the moment layout complexity increases, manual rule-writing begins

What OCR adds when text was never encoded — and what it costs

  • On a scanned PDF, no text layer exists — every extraction method must run OCR before any table logic applies; the accuracy of that OCR pass sets a hard ceiling on everything downstream
  • Standard OCR reads left-to-right, top-to-bottom — tables break that assumption immediately
  • A three-column financial table gets linearised into a single character stream where row relationships collapse and column alignment disappears before any table-detection logic runs
  • The compounding error problem:
    • OCR errors corrupt positional data
    • Positional errors corrupt table structure reconstruction
    • Each step multiplies the error of the previous one — scanned extraction is not just slower, it is structurally less reliable
  • Speed cost is concrete: EasyOCR achieves 97.32% accuracy on Unicode-compatible documents but takes 14.25 seconds per page — against PyMuPDF's 0.007 seconds on native documents — illustrating the processing penalty of the OCR step even when accuracy is high (per arxiv.org/pdf/2407.04577)
  • Additional scan-quality variables that native extraction never faces: skew and rotation, low contrast, shadow from page curl, mixed font quality, faded ink on older documents
  • These variables are why a method that achieves high accuracy on clean scans may fail substantially on degraded archival documents — the OCR accuracy number is document-condition-dependent, not a fixed property of the tool

What layout detection models do differently from OCR pipelines

  • OCR reads character sequences; layout detection models identify bounding regions first — table boundaries, column separators, row spans, and merged cells are resolved geometrically before any text is extracted
  • Position is treated as data: row membership, column alignment, and cell adjacency are resolved spatially before reading, which is why they recover merged cells, multi-line headers, and rotated tables that rule-based extractors miss
  • Vision Language Models (VLMs) take this further — reading the document as an image and parsing layout structure before field extraction, preserving grid structure across page boundaries where template-based extractors reset per page
  • LLM-based extraction: the model is given a schema (item, quantity, price) and fills rows based on contextual understanding — handles layout variation and implicit row groupings that break coordinate parsers
  • The dual-approach method from the BIC 2024 conference (Lymantama, Rustam, Novkaniza, Universitas Indonesia) formalises this logic:
    • Step 1: identify document type — native or scanned
    • Step 2 for scanned: apply projection profile method to correct slanted text, then advanced object detection techniques to detect table columns
    • Step 3: extract using two different software tools, then reconstruct correct order
    • Results: 100% accuracy, precision, and recall on native PDFs; average character-level accuracy of 96.22% and word-level accuracy of 84.14% on scanned bank statements from Indonesian banks
  • The 96.22% character-level vs 84.14% word-level gap is instructive — OCR character errors cascade into word-level failures at a meaningful rate, which matters for downstream systems that parse field values rather than individual characters

Where even modern pipelines still fail consistently

  • The generalisability problem: a KDD 2026 benchmark across roughly 86,000 pages found that table extraction methods suffer from a lack of generalisability when facing heterogeneous data — accuracy on one document class does not transfer reliably to another
  • Multi-page tables remain an unsolved edge case for most tools: headers must be reassociated across page boundaries, a step most parsers skip entirely
  • Merged cells that span rows and columns simultaneously defeat uniform grid assumptions in both coordinate parsers and many layout models
  • Clinical context example: a practitioner testing twelve leading tools on clinical study protocols found the Schedule of Activities table — often spanning multiple printed pages — exposed the limits of every tool; in that context, extraction error is a patient safety issue, not a data quality inconvenience
  • The schema-consistency challenge: pipelines that achieve high accuracy on repetitive, standardised document types often require significant retraining or reconfiguration when document layout changes — a common real-world occurrence with supplier invoice variations
  • Borderless tables on scanned documents combine the hardest elements of both failure modes: no grid lines to detect, OCR positional noise, and whitespace gaps that shift with scan quality

Matching the right tool to the document type

  • The primary filter before any tool selection: identify whether the document batch is native, scanned, or mixed — the tool that excels on one type is often completely ineffective on the other
  • For native PDFs without OCR needs:
    • Tabula: low configuration overhead, reliable on clean grid-bordered tables, fails on merged cells and borderless layouts
    • Camelot: Lattice mode reliable when borders present, Stream mode requires manual separator configuration — breaks on layout variation in production
    • pdfplumber: finest control, handles edge cases the above cannot, but every new layout variant requires new extraction code
  • For scanned PDFs requiring OCR:
    • PyTesseract: 97.71% accuracy on image-embedded PDFs where coordinate parsers return nothing at all (per arxiv.org/pdf/2407.04577)
    • EasyOCR: 97.38% accuracy on image-embedded PDFs — comparable to PyTesseract but at a significant latency cost
    • ABBYY FineReader: enterprise-grade, handles complex multi-page tables, nested structures, borderless layouts, and over 200 languages; sized for high-volume enterprise processing, with pricing and implementation complexity to match — not appropriate for smaller teams
  • For both types, AI-powered:
    • Lido: AI-powered extraction from scanned and native PDFs without templates or training; handles merged cells, multi-page tables, and irregular row structures; outputs spreadsheet-ready format; SOC 2 Type II and HIPAA compliant; 50 free pages with no credit card required
    • Amazon Textract: cloud API returning structured cell output with row and column relationships; handles scanned and native; requires engineering resources to bridge raw cell output to usable data; native to AWS ecosystem
    • Azure AI Document Intelligence: custom models with cell-level confidence scores and visual labelling for custom model training; deepest value inside Microsoft 365 and Power Automate environments
    • Google Document AI: accurate table structure detection with header identification; custom processor training via Document AI Workbench requires labelled data but not dedicated ML expertise, as the platform handles model training automatically; strongest for teams already on GCP
  • Layout-detection approach at production scale: Extend's Parse 2.0 uses a vision model trained on over a million documents, achieving 0.847 Adjusted F1 on layout accuracy, extracting borderless tables without per-document tuning
  • Framework-level choice for document intelligence pipelines: a 2025 benchmark on sustainability reports (Procycons) found Docling the superior framework for precision and structural fidelity in complex table extraction; LlamaParse suited to quick, simple extractions; Unstructured appropriate for lightweight tasks but insufficient for comprehensive document processing
  • Decision shortcut: teams with a uniform, high-volume document type and engineering resources should evaluate API-based tools; teams needing immediate usable output without engineering overhead should start with AI-native tools that handle both document types without configuration

Building a pipeline that handles both document types in the same batch

  • The practical problem: a single document batch from a real business operation typically contains both native and scanned PDFs — supplier exports alongside faxed paperwork, digital invoices alongside scanned receipts
  • Document-type detection as the mandatory first step:
    • Attempt text layer extraction — if the text layer is empty or returns only noise characters, treat as scanned
    • Route native documents to coordinate-based or LLM extraction; route scanned documents to OCR-first pipeline
    • Mixed-page documents — some pages native, some scanned — require per-page type detection, not per-document
  • Preprocessing for scanned documents before OCR:
    • Deskewing and rotation correction (the projection profile method used in the BIC 2024 study directly addresses slanted-text errors before OCR runs)
    • Contrast enhancement for low-quality or faded scans
    • Resolution upsampling for very low-DPI source images
  • Post-extraction validation regardless of document type:
    • Row count consistency checks across multi-page tables
    • Numeric field format validation (decimals, currency symbols) — OCR character errors cascade into word-level failures at a meaningful rate, as the 96.22% vs 84.14% gap from the BIC 2024 study illustrates
    • Header reassociation logic for tables that span page boundaries
  • The downstream-use test: a table is only "extracted" when it lands in a usable format with correct columns, rows, and field values — technically-created output that requires manual cleanup is failed extraction, not successful extraction
  • For teams scaling beyond a single document type or processing documents across multiple clients or brands, the operational burden shifts from per-document tuning to pipeline governance — consistent schema enforcement, exception handling, and output monitoring become the bottleneck, not the extraction step itself

Notes

  1. PDF Table Extraction: Layout vs OCR (August 2026) | Extend

    Supplied the layout-detection versus OCR comparison and the Parse 2.0 layout accuracy figures.

  2. Best Table Extraction Software in 2026

    Provided the tool-by-tool descriptions of Lido, Textract, Azure and Google Document AI.

  3. Table Extraction Benchmark: Scanned vs Native PDFs

    Informed the scanned-versus-native benchmark discussion and the point that accuracy does not generalise across document classes.

  4. How to Extract Tables from PDFs Automatically: OCR, AI & LLM Methods Compared

    Covered the comparison of OCR, AI and LLM extraction methods, including schema-driven LLM extraction.

  5. Native vs. Scanned PDF Files | PDF2XL Help Center

    Explained the native versus scanned distinction and how to tell the two apart.

  6. Scanned vs native PDFs, how to differentiate them ? - Open Preservation Foundation

    Supported the explanation of how to detect whether a PDF is native, scanned or mixed.

  7. https://imagetotable.ai/blog/why-ocr-accuracy-drops-document-type

    Informed the discussion of how scan quality and document condition drive OCR accuracy.

  8. https://arxiv.org/pdf/2603.13398

    Likely the source of the KDD 2026 benchmark finding on poor generalisability across heterogeneous documents.

Every new piece from The Parse Layer, as it's published.

Follow

Tomasz Wierzbicki

More from The Parse Layer

  1. October 30, 2026Detecting Borderless Tables in Scanned Financial and Insurance Documents8 min read →
  2. November 11, 2026Layout Analysis for Multi-Column Academic Papers8 min read →
  3. September 15, 2026Table Structure Recognition Models Compared on Spanning Cells10 min read →