Skip to content
Courses/Advanced and secure RAG/OCR and Tables in Real-World PDFs

OCR and Tables in Real-World PDFs

Easy PDFs already have selectable text. Real enterprise PDFs include scans, columns, stamps, split tables, and skewed invoices. If you don't process that layer properly, your RAG starts out confused.

  • Decide when you need OCR and when plain text extraction is enough.
  • Preserve tables, pages, and metadata before indexing.
  • Create a reviewable intermediate output before embeddings.

Recommended pipeline

Terminal
PDF or image
  -> detect if selectable text exists
  -> OCR if needed
  -> reconstruct reading order
  -> extract tables as HTML/Markdown/JSON
  -> add metadata: document, page, section
  -> sample review
  -> chunking and indexing

Example with Docling

Docling is designed to convert complex documents into structure useful for AI: text, tables, layout, and exportable formats.

Terminal
pip install docling

docling invoice.pdf --to md --output docling_output/

# Review before indexing:
ls docling_output
cat docling_output/invoice.md

Output format for invoices

Terminal
{
  "document_id": "invoice-2026-001",
  "page": 1,
  "type": "invoice",
  "supplier": "Supplier S.L.",
  "invoice_number": "F-2026-001",
  "date": "2026-07-02",
  "total": 242.00,
  "currency": "EUR",
  "table_rows": [
    {"concept": "Monthly service", "base": 200.00, "vat": 42.00}
  ],
  "source_text": "verifiable fragment..."
}
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue