1.  [](/)
2.  [Code examples](/recipes)
3.  PDF Data Extraction Pipeline

Back to code examples

Training

# PDF Data Extraction Pipeline

Extract structured data from PDFs including tables, forms, and text. Convert unstructured documents into structured, queryable data.

text

image

Multi-Tier

[Run in Builder](/build?recipe=pdf-extraction-pipeline)

Python

cURL

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="pdf-data")

\# 1. A bucket for the invoices, and a collection that splits every page into

\#    classified blocks (paragraph, table, form, list, header, figure) with OCR text

bucket \= client.buckets.create(

    bucket\_name\="invoices",

    bucket\_schema\={"properties": {"invoice": {"type": "pdf"}}},

)

collection \= client.collections.create(

    collection\_name\="invoices",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "document\_graph\_extractor",

        "version": "v1",

        "parameters": {

            "layout\_detector": "docling",

        },

    },

)

\# 2. Upload and process

client.buckets.upload(

    bucket\["bucket\_id"\],

    blobs\=\[{"property": "invoice", "type": "pdf", "data": "s3://your-bucket/invoices/inv-1042.pdf"}\],

)

client.collections.trigger(collection\["collection\_id"\])

\# 3. Pull the table blocks, with page and bounding box

tables \= client.documents.list(

    collection\["collection\_id"\],

    filters\={"AND": \[{"field": "object\_type", "operator": "eq", "value": "table"}\]},

)

for block in tables\["results"\]:

    print(block\["page\_number"\], block\["bbox"\], block.get("text\_corrected") or block\["text\_raw"\])

### Feature Extractors

Document Graph Extractor

Decompose PDFs into spatial blocks (paragraphs, tables, forms, headers) with layout classification and E5 text embeddings.

### Retriever Stages

## Frequently asked questions

### Can it extract data from forms?

Yes. The pipeline identifies form fields and their values, outputting structured key-value pairs.

### Does it handle multi-column layouts?

Yes. The layout analysis component correctly identifies columns, headers, and reading order in complex documents.

### What about handwritten content?

The OCR extractor supports printed and handwritten text recognition with varying accuracy depending on handwriting quality.

## Use Cases Using This Recipe

Advanced

8 min

### SNF Documentation Intelligence

Automate MDS assessments and clinical documentation for skilled nursing facilities

40% less time on charting

Documentation time reduction

[

healthcare

](/solutions/healthcare)

Who It's For

SNF operators, MDS coordinators, directors of nursing, and post-acute care organizations managing clinical documentation across skilled nursing facilities

[View Details](/use-cases/snf-documentation-intelligence)

Intermediate

### Insurance Claims Document Processing

Extract structured data from claims documents, photos, and correspondence automatically

70% reduction in manual document handling

Adjuster data entry time

insurance

Who It's For

Insurance carriers, claims adjusters, and third-party administrators processing 1,000+ claims monthly across property, casualty, auto, and health lines

[View Details](/use-cases/insurance-claims-document-processing)

Intermediate

### Enterprise RAG Search

Ask questions across all your enterprise data and get sourced, verifiable answers

80% faster from question to answer

Information retrieval time

[

finance

](/solutions/finance)

Who It's For

Financial services firms, consulting organizations, legal teams, and enterprise knowledge workers who need to synthesize information across thousands of internal documents, reports, and presentations

[View Details](/use-cases/enterprise-rag-search)

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Extractor

### Document Graph Extractor

Decompose PDFs into spatial blocks (paragraphs, tables, forms, headers) with layout classification and E5 text embeddings.

Learn more





](/extractors/document-graph)[

Recipe

### Document Intelligence Search

Extract and search through PDFs, presentations, and documents. Combines OCR, layout analysis, and semantic search for comprehensive document retrieval.

Learn more





](/recipes/document-search-pipeline)[

Recipe

### Document RAG Pipeline

Retrieval-augmented generation for document collections. Extracts text, tables, and figures from PDFs using OCR and layout analysis, then retrieves relevant page sections to answer natural language questions with precise page and section citations.

Learn more





](/recipes/document-rag-pipeline)[

Recipe

### Document Classification Pipeline

Classify documents into custom business categories using layout-aware extraction and taxonomy enrichment. Handles invoices, contracts, reports, forms, and correspondence by analyzing both textual content and visual document structure.

Learn more





](/recipes/document-classification)[

Recipe

### BYO Embeddings Vector Search

Bring pre-computed embeddings from any provider (OpenAI, Cohere, Together, etc.) and upsert them directly into MVS for instant vector search. No feature extractors, no pipelines -- just embeddings in, results out.

Learn more





](/recipes/mvs-byo-embeddings-search)[

Extractor

### Web Scraper

Extract structured data from webpages while maintaining semantic context and relationships

Learn more





](/extractors/web-scraper)