Extract tables from PDF invoices, receipts and bank statements to JSON, with OCR only where it's needed A developer built an Apify Actor that extracts tables from PDF invoices, receipts and bank statements into JSON and Markdown, using IBM's open-source Docling (layout analysis plus the TableFormer table model) and RapidOCR bundled inside the Actor. The tool applies OCR only to pages lacking an embedded text layer, with auto, always and never modes, and returns one dataset row per document containing tables_json, full_markdown and per-page status. Pricing runs from $0.005 per digital page and $0.02 per OCR page on the free plan, with failed and skipped documents billed at no cost. Getting tables out of PDFs is one of those tasks that looks solved until you try it on real documents: camelot and tabula work on clean, ruled tables, but miss I built an Apify Actor for this: Invoice, Receipt & PDF Table to JSON / Markdown OCR https://apify.com/panix/invoice-table-json-extractor . It uses IBM's open-source Docling layout analysis plus the TableFormer table model and RapidOCR , all bundled inside the Actor. There's no external API key, and documents aren't sent to a third-party AI service. This post shows what comes out and how to call it from Python or an n8n workflow. Every PDF page is checked for an embedded text layer: You can force ocrMode: "always" when a PDF's embedded text is garbled, or "never" to skip OCR completely. One dataset row per document. This is the output for a public sample invoice, shortened: { "file name": "wordpress-pdf-invoice-plugin-sample.pdf", "document type": "pdf", "status": "success", "pages total": 1, "pages digital": 1, "pages ocr": 0, "table count": 3, "tables json": { "table index": 1, "page number": 1, "headers": "Hrs/Qty", "Service", "Rate/Price", "Adjust", "Sub Total" , "rows": { "Hrs/Qty": "1.00", "Service": "Web Design This is a sample description...", "Rate/Price": "$85.00", "Adjust": "0.00%", "Sub Total": "$85.00" } , "row count": 1, "column count": 5 } , "full markdown": " From:\nDEMO - Sliced Invoices ...\n\n| Hrs/Qty | Service | Rate/Price | Adjust | Sub Total |\n|---|---|---|---|---|\n| 1.00 | Web Design ... | $85.00 | 0.00% | $85.00 |", "processing time secs": 6.1 } Some details that save you cleanup work: Amount and Amount 2 , so no cell gets overwritten. Empty cells are null . full markdown keeps headings, reading order and tables. It works for an LLM prompt or a RAG index. "status": "failed" with a reason, and it never stops the rest of the batch. Links must return the file itself, not a preview page. Signed S3 links work, and tokens in links never show up in the log. python import pandas as pd from apify client import ApifyClient client = ApifyClient "