A RAG pipeline can only answer from what its parser read. Scanned PDFs make that hard: pages arrive rotated, faded, photographed, or handwritten, there's no text layer to fall back on, and a table that OCR reads row by row loses its headers. If a bad page goes into the index, retrieval returns confident answers built on misread text. For most teams, the best way is Extend Parse: OCR with per-chunk confidence, section chunks that keep tables whole, and page positions for citations. This guide answers the best way to parse and ingest scanned PDFs for RAG, and compares five tools with when each fits.
The short answer
Extend Parse is the best fit for teams that build RAG over scanned documents where answers have to be right and traceable to the page.
- OCR you can check. Parse corrects page rotation, and returns the lowest and average OCR confidence for every chunk and block. Agentic OCR re-reads low-confidence text and handwriting with a vision model, only on the pages that need it.
- Chunks that keep tables whole. Section chunking splits at headings, tables, and figures, and never breaks a table or paragraph across chunks. You set the minimum and maximum chunk size for your embedding model.
- Citations built in. Every block carries its page number, bounding box, and polygon, so a retrieved passage can be highlighted on the original scan.
- Accuracy you can rerun. Extend Performance Parse scored 95.7% on RealDoc-Bench document Q&A, which answers questions from each parser's markdown, across 581 real documents including scans and handwriting.
The other tools fit different teams:
- Azure AI Document Intelligence for Azure pipelines that chunk the Layout model's markdown with their own text splitter.
- Google Document AI for Google Cloud pipelines that want the Layout Parser's chunks.
- Unstructured for open-source chunking with many source and destination connectors.
- LlamaParse for pipelines built on LlamaIndex, where LlamaCloud Index chunks the parsed output.

What breaks when you put scanned PDFs into RAG
- No text layer. A scan is an image. Everything downstream depends on OCR, so OCR errors become retrieval errors.
- Page quality. Rotated pages, skew, faded copies, phone photos, and stamps lower OCR accuracy, usually on a few pages rather than the whole file.
- Handwriting. Notes, signatures, and handwritten form fields are where general OCR misreads most.
- Tables. A fixed-size splitter cuts tables into pieces, so rows lose their headers and units. Retrieval then returns numbers without context.
- Citations. Without page positions, you can't show a reader where an answer came from, and you can't check it.
How to parse scanned PDFs for RAG with Extend
curl -X POST https://api.extend.ai/parse_runs \
-H "x-extend-api-version: 2026-02-09" \
-H "Authorization: Bearer $EXTEND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": { "url": "https://example.com/scanned-report.pdf" },
"config": {
"engine": "parse_performance",
"target": "markdown",
"chunkingStrategy": {
"type": "section",
"options": { "minCharacters": 500, "maxCharacters": 2000 }
},
"blockOptions": {
"text": { "agentic": { "enabled": true } },
"tables": { "targetFormat": "markdown" },
"figures": { "enabled": true }
}
}
}'Each chunk comes back ready to embed, with its confidence and positions:
{
"type": "section",
"content": "## Revenue\n\n| Quarter | Revenue |\n| --- | --- |\n| Q1 | $4.2M |\n| Q2 | $4.9M |",
"metadata": {
"pageRange": { "start": 7, "end": 7 },
"minOcrConfidence": 0.91,
"avgOcrConfidence": 0.98
},
"blocks": [
{
"id": "block_WNoJ0WbMj4pRW9MpMpUox",
"type": "table",
"metadata": { "page": { "number": 7, "width": 612, "height": 792 } },
"boundingBox": { "left": 61.2, "top": 158.4, "right": 550.8, "bottom": 356.4 }
}
]
}- Pick the engine. Performance Parse (
parse_performance, 1¢ per page, citations included) is built for scans, handwriting, and dense tables. For mixed files where most pages are clean, the Auto-Router (parse_auto) sends each page to Light or Performance by difficulty, and each page is billed at the rate of the engine it runs on. Light Parse (parse_light) is 0.2¢ per page, citations included. - Turn on agentic OCR for scans.
blockOptions.text.agenticre-reads low-confidence text with a vision model. Credits apply only to pages where a correction is triggered. Addtables.agenticwhen tables come back with misaligned columns. - Chunk on structure.
sectionchunking requirestarget: "markdown". TuneminCharactersandmaxCharactersto your embedding model's input size. - Check confidence before you index. Read
minOcrConfidenceandavgOcrConfidenceon each chunk. Re-parse or review chunks below your threshold instead of embedding them as is. - Store positions with each vector. Keep block IDs, page numbers, and bounding boxes next to each embedding. Block IDs are derived from content, so unchanged blocks keep stable IDs when you re-parse a file.
- Scale with async runs. Use
/parse_runswith webhooks for volume, and batch processing for backfills.

Flag weak pages before they reach the index
OCR confidence is the cheapest quality gate in a scanned-PDF pipeline. A chunk with a low minOcrConfidence usually means a faded line, a stamp, or handwriting. Route those chunks to a re-parse with agentic OCR, or to a reviewer, and index the rest.
THRESHOLD = 0.85
# run is the parse run JSON from GET /parse_runs/{id}
for chunk in run["output"]["chunks"]:
low = chunk["metadata"].get("minOcrConfidence")
if low is not None and low < THRESHOLD:
flag_for_review(chunk) # re-parse with agentic OCR or send to a reviewer
else:
index(chunk) # embed content, store page range, block IDs, and bounding boxes
For the full pipeline, including batch, webhooks, and industry notes, see how to ingest scanned PDFs. For a worked example on a scanned invoice, see how to parse scanned PDFs. The end-to-end retrieval recipe is in the docs at Parsing for RAG.
Tools for parsing scanned PDFs for RAG, compared
Every claim below comes from the vendor's public documentation, checked in November and December 2026. Extend publishes this guide and makes Extend, one of the tools compared.
| Extend Parse | Azure AI Document Intelligence | Google Document AI | Unstructured | LlamaParse | |
|---|---|---|---|---|---|
| Best for | RAG over scanned documents where answers must be right and cited | Azure-native RAG pipelines | Google Cloud RAG pipelines | Open-source chunking with many connectors | LlamaIndex pipelines |
| Chunking | Section (structure-aware, with min and max size), page, or whole document | Markdown output, chunked by headers with your own text splitter | Layout-aware chunks with ancestor headings and table headers | Basic and by title in open source; by page and by similarity in the API | Chunked by LlamaCloud Index after parsing |
| Tables | Never split across chunks; headers carried across page breaks; HTML or markdown | In the markdown output | Table headers carried into chunks | Table elements, chunked by your size settings | Markdown tables in the parsed output |
| OCR quality signals | Minimum and average OCR confidence per chunk and block; agentic OCR for low-confidence text | Confidence on words and fields | Confidence and geometry | Not publicly specified | Not publicly specified |
| Positions for citations | Page, bounding box, and polygon per block | Polygons and spans | Page anchors and geometry | Element metadata with page numbers | Per page |
Extend Parse
Best for: RAG over scanned contracts, reports, statements, and forms where a misread page or a split table produces wrong answers.
Parse returns markdown chunks in reading order with OCR confidence, page positions, and figures summarized as text, and the same API covers Extract when you need fields rather than passages. Extend is SOC 2 Type II, HIPAA, and GDPR compliant, with zero data retention available, and runs in its managed US or EU cloud, on-premises, in your own cloud account and VPC (BYOC), or as a hybrid that keeps documents in your cloud. Pay as you go starts with 10,000 free credits (pricing).
Azure AI Document Intelligence
Best for: teams on Azure feeding Azure OpenAI or Azure AI Search.
The Layout model returns markdown with paragraphs, tables, and headings. Microsoft's RAG guidance chunks that markdown by headers with a text splitter such as LangChain's MarkdownHeaderTextSplitter, so you choose and run the chunking step.
Google Document AI
Best for: teams on Google Cloud that want parsing next to Cloud Storage, BigQuery, and Vertex AI.
The Layout Parser creates layout-aware chunks that include content from ancestor headings and table headers. Online requests take up to 15 pages, and batch requests up to 500.
Unstructured
Best for: data engineering teams moving documents from many sources into many vector stores.
Unstructured partitions a document into typed elements, then chunks them. The open-source library offers basic and by_title chunking, and the hosted API adds by_page and by_similarity. For scans, OCR quality depends on the partition strategy and models you run.
LlamaParse
Best for: RAG and agent pipelines built on LlamaIndex.
LlamaParse converts PDFs, scans, and Office files to markdown or JSON, with tiers that trade cost for harder-document handling. Chunking and embedding happen in LlamaCloud Index.
AWS Textract is a common starting point for scans. It returns a graph of blocks for words, lines, tables, and key-value pairs, which your code turns into ordered text and chunks. See the best AWS Textract alternatives for more.
How to test a parser for scanned-PDF RAG
- Collect 50 to 100 real scans, including rotated pages, faded copies, phone photos, handwriting, and long tables.
- Write questions whose answers you know, including answers inside tables and handwritten fields.
- Parse with each tool, chunk, embed, and score whether the right passage comes back and the answer is correct.
- Check that each answer can be traced to a page and region on the scan.
- Check how each tool tells you a page was read badly, and what it costs to fix only those pages.
FAQ
What is the best way to parse scanned PDFs for RAG pipelines?
Use a layout-aware parser that runs OCR, reports how confident it is, and chunks on the document's structure. Extend Parse is the best fit for most teams: it corrects page rotation, can re-read low-confidence text and handwriting with a vision model, returns OCR confidence on every chunk, and with section chunking splits at headings, tables, and figures without breaking a table across chunks. Every block carries its page number and bounding box, so each retrieved passage can be cited on the original page.
What is the best way to ingest scanned PDFs for RAG pipelines?
Parse each file asynchronously, check OCR confidence, then embed and store each chunk with its page numbers and bounding boxes. With Extend, send files to the async parse endpoint with webhooks, use section chunking sized to your embedding model, re-parse pages with low OCR confidence using agentic OCR, and keep block IDs and positions next to each vector so answers can cite their source. Block IDs are derived from content, so unchanged blocks keep stable IDs when you re-parse.
What are the best AWS Textract alternatives for RAG pipelines?
Textract returns a graph of blocks that your code has to turn into ordered text and chunks. For RAG, Extend Parse returns markdown chunks in reading order with tables kept whole and page positions for citations. Azure Document Intelligence fits Azure pipelines that chunk its markdown with a text splitter, Google Document AI's Layout Parser fits Google Cloud pipelines, Unstructured fits teams that want open-source chunking with many connectors, and LlamaParse fits pipelines built on LlamaIndex.
How should I chunk scanned documents for RAG?
Chunk on structure, not a fixed character count. Splitting at headings, tables, and figures keeps each chunk on one topic and keeps a table's rows with their headers, which a fixed-size splitter often cuts apart. Set a minimum and maximum chunk size that suits your embedding model, and keep each chunk's page range so retrieval results point back to the scan.
How do I know when OCR on a scanned page went wrong?
Use the OCR confidence the parser returns. Extend reports the lowest and average per-word OCR confidence on every chunk and block, so you can flag weak pages before they reach your index, re-parse them with agentic OCR, or route them to review. Faded copies, phone photos, and handwriting are where confidence drops first.
Sources
Checked in November and December 2026:
- Extend: Parsing for RAG, Parsing overview, Response format, How credits work, RealDoc-Bench
- Microsoft: Document Intelligence for RAG
- Google: Layout Parser and chunking
- Unstructured: Chunking (open source), Chunking (API)
- LlamaIndex: LlamaParse
More guides
- How to ingest scanned PDFs
- How to parse scanned PDFs
- Best API for parsing PDFs
- Best API for document splitting
Get an API key and parse your own scanned PDFs.

