GuideSlate Editorial Library — Full English AI tool tutorials are 100% free · Companion .zip starter kits $9.90 one-time All kits
n8n & automation Updated Nov 2026 · v2.2 · Saves 7 hrs · Intermediate

Extract multi-column PDFs and financial tables into clean JSON with MinerU

Standard PDF parsers mangle two-column layouts, footnotes, and merged financial tables. Run MinerU (magic-pdf) with a post-processing LLM validator to output clean Markdown and typed JSON.

ARCHITECTURE PIPELINE
01 · LayoutMinerU PDF detect02 · TableHTML/LaTeX parse03 · SchemaDeepSeek/GPT JSON04 · StoreChunked RAG index

Why default setups fall short

When building contract review, invoice auditing, or research RAG tools, naive PyPDF text extraction scrambles reading order across multi-column pages and destroys table cell alignment. Indie builders across Chinese and global AI communities have standardized on MinerU (magic-pdf) to detect layout bounding boxes first, convert tables into structured HTML/Markdown, and then pass only the clean table blocks to a low-cost reasoning model for JSON extraction.

Prerequisites before starting

  • Docker or Python 3.10+ environment for MinerU (magic-pdf)
  • Sample multi-column PDFs (invoices, 10-K filings, or academic papers)
  • OpenAI-compatible API key (DeepSeek V3, GPT-4o-mini, or Gemini Flash)

Step-by-step implementation

STEP 01

1. Run MinerU in auto/ocr mode to separate reading order from headers

MinerU segments each page into title blocks, body columns, footnotes, formulas, and table regions, stripping repeating page headers and footers that normally pollute RAG vector chunks.

magic-pdf -p ./input-contracts/ -o ./parsed-output/ -m auto
STEP 02

2. Preserve extracted HTML table blocks alongside Markdown prose

MinerU outputs a *_content_list.json file alongside the Markdown document, preserving exact row-span and col-span HTML table structures so numbers never shift columns.

# Filter table blocks from MinerU content_list.json
tables = [blk for blk in content_list if blk.get("type") == "table"]
STEP 03

3. Validate numeric totals with a deterministic Python checksum

After prompting your LLM to convert a parsed table into typed JSON line items, run an automatic Python sum check against the stated invoice or balance-sheet total and flag any discrepancy > $0.01.

calculated = round(sum(item["amount"] for item in data["line_items"]), 2)
assert abs(calculated - data["stated_total"]) <= 0.01, "Checksum mismatch"
STEP 04

4. Chunk by heading hierarchy with parent-section breadcrumbs

Prepend each vector chunk with its document title and H1/H2 breadcrumb path (e.g., [MSA-2026 > Section 4: Liability Cap]) so retrieval never loses context.

More practical field guides

View all 12 guides
Claude & Cursor skills Featured kit
Saves 4.5 hrs · v2.4
Replace generic AI interfaces with a custom SKILL.md design token system

How top solo builders force Claude Code, Cursor, and Antigravity to output studio-grade editorial interfaces instead of default blue-gray Tailwind cards.

01 · InputSKILL.md rules02 · Tokens6-hex palette03 · GuardrailAnti-cliche lint04 · OutputEditorial SSR UI
Companion .zip starter kit (4 files) $9.90 one-time
01-editorial-frontend-SKILL.md (6.4 KB)02-cursor-anti-slop-rules.mdc (3.8 KB)03-architectural-bento-tokens.css (5.1 KB)README-quickstart.md (2.2 KB)
Read free guide
n8n & automation
Saves 6 hrs · v3.1
Monitor X and Reddit buying-intent threads every 15 minutes with n8n

Skip $99/mo social listening SaaS tools. Poll targeted RSS and search endpoints, score high-intent leads with a low-cost Flash LLM, and push ready-to-reply alerts to Slack.

01 · Cron 15mSearch feeds02 · DedupSQLite hash03 · Flash LLMScore >= 8/1004 · WebhookSlack alert
Companion .zip starter kit (4 files) $9.90 one-time
01-n8n-intent-radar-v3.json (11.2 KB)02-intent-classifier-prompt.md (3.4 KB)03-docker-compose.n8n.yml (1.9 KB)README-quickstart.md (2.0 KB)
Read free guide