RAG with scanned PDFs and tables: when you need OCR and structured extraction

Published on 2026-11-16 by ArduBot

Why complex PDFs give incorrect answers in RAG and how to process scans, tables, headers, versions, and citations.

Uploading a PDF does not guarantee that a RAG can understand it. Manuals with tables, invoices with columns, and scanned documents are especially delicate: if extraction loses relationships, the model receives incorrect data even if its wording is impeccable.

First identify the type of PDF

A digital PDF usually contains selectable text. A scanned PDF stores pages as images and may require OCR. Many documents mix text, images, footers, and tables. The extractor must indicate when a page was left blank or presented low confidence; hiding that failure produces misleading responses.

Think of a spare parts table: “model”, “voltage”, “compatible part”, and “revision”. If the parser concatenates each column separately, it can associate a part with the wrong model. Semantic search will find that defective text and the model will repeat it.

What a good extraction must preserve

- Hierarchy: titles, subtitles, and sections, so that each fragment has context. - Rows and columns: relationship between headers and cells, not just plain text. - Pages and coordinates if necessary: they allow showing the user where the evidence is. - Metadata: version, language, date, origin, and access scope.

For large tables it may be preferable to convert them into structured records and query them by filters or SQL. Not all answers about tabular data need embeddings.

Strategies for fragmenting without losing meaning

In a procedure, cut by complete sections and keep the title as metadata. If a paragraph includes “except models manufactured before 2024”, do not separate it from the main rule. In tables, incorporate headers into each row converted to text or preserve a queryable structure.

Avoid a universal chunk size. Narrative manuals and technical datasheets require different strategies. Test representative samples before processing thousands of files.

A simple test case

Load a catalog with three tables and 20 verifiable questions. Include at least five on exceptions and five on exact values. Compare: extracted text, found fragment, answer, and cited page. If extraction fails, changing the generative model rarely solves the root cause.

Add two scanned PDFs with different quality; measure readable pages, omitted fields, and OCR cost. Define what threshold requires human review.

When NOT to use RAG

If you need to sum invoice amounts, reconcile line items, or guarantee accounting accuracy, extract into a validated structure and use deterministic logic. A RAG can help find the explanatory section, but it should not replace numerical controls.

Product opportunity

An automatic RAG node that accepts PDFs must report which documents it could process, which ones need OCR, and which parts it could not interpret. That transparency is worth more than a button that always responds “indexed”.

At ArduMaker we are evaluating a service that processes sources and delivers searches via API. Are your documents digital PDFs, scans, or tables? Describe your case at ArduMaker.

References: Content preparation for RAG in Azure · Knowledge bases in AWS.

  • RAG
  • PDF
  • OCR
  • tablas
  • extracción de datos

Keep reading

All articles · VPS plans