PDF Tables to JSON with Cell Coordinates + RAG Chunks (OCR)
Pricing
from $3.00 / 1,000 pdf page processeds
PDF Tables to JSON with Cell Coordinates + RAG Chunks (OCR)
PDF to JSON: every table as rows of cells with page number and bounding box, RAG-ready text chunks with page references, plus page text and Markdown. PDF table extraction and PDF parser for AI agents and data pipelines, optional OCR for scanned PDFs, pay per page.
Pricing
from $3.00 / 1,000 pdf page processeds
Rating
0.0
(0)
Developer
Landon Brewington
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Share
Give this Actor PDF URLs and get structured JSON back. Two things set it apart from the usual PDF text extractor:
- Tables as cells with coordinates. Every table comes back as
rows(an array of rows, each row an array of cell strings, already split), with itspagenumber, abbox[x0, top, x1, bottom]in PDF points, a detectedheader, a GitHub Markdown rendering, and, on request, abboxfor every single cell. You can link any value back to the exact spot on the page. - RAG-ready chunks with page references. Page text is split into sentence-aligned chunks of a size you choose, each carrying
page,chunkIndex,charStart,charEndand acitationobject, so citations in a retrieval pipeline point at a page and a character range, not just a file. The chunks use the same schema as the sibling Actor transcribe-to-json-chunks, which returns recordings as chunks with time citations, so one pipeline can ingest PDFs and audio or video the same way.
On top of that you get each page's plain text, a Markdown version (headings by font size, tables in place), PDF metadata, and optional OCR for scanned pages. It is a PDF to JSON converter, a PDF table extraction tool, a PDF parser, a PDF to Markdown converter and a RAG chunker in one call, priced per page.
What it does
- Downloads each PDF from the URL you give (up to 100 per run, 50 MB each by default), checks that it really is a PDF, and parses it page by page. Nothing is stored after the run: the file is deleted as soon as it is parsed.
- Tables: ruled tables are found by their lines; when ruled columns have no row lines the cells are re-read by text rows; tables without any lines are found by text alignment with strict quality filters (at least 3 rows, 2 columns, half the cells filled, some numeric content) so paragraphs do not come back as fake tables. Overlapping detections are merged, tables under 2 rows or 2 columns are dropped. Each table has
tableIndex,page,bbox,rowCount,columnCount,header(array or null),rows,markdown,strategy, and withincludeCellBoxesacellsarray of{row, col, text, bbox}. - Text: reading-order text per page with line breaks. Pages whose generator wrote no space glyphs (common with TeX and some report tools) still come back with proper word spacing.
- Markdown: lines whose font is 20 percent above the page's body text become
##headings, wrapped lines are joined into paragraphs, tables are rendered as Markdown tables where they appear. - Chunks:
chunkSizecharacters (default 1200, about 300 tokens) withchunkOverlap(default 150), cut at sentence ends when possible. Offsets are into that page'stext. Each chunk carriescitation: {"type": "page", "page": 2, "label": "p. 2"}(see Family below). - OCR:
off(default),auto(only pages with fewer than 20 characters of text layer) oralways. Pages are rendered at 200 dpi and read with Tesseract. OCR pages return text, Markdown paragraphs and chunks; withincludeWordBoxesalso word boxes with confidence. About 2 to 3 seconds per page. - Two output shapes:
pages(one dataset item per page, the default, ideal for RAG) ordocuments(one item per PDF withmetadata, all text joined by form feeds, and every table and chunk tagged with its page). - A PDF that cannot be fetched or read never fails the run: it produces one item with
erroranderrorType(http_403,http_404,not_pdf,too_large,timeout,encrypted, ...) and is not charged. The other PDFs still return data.
Who it is for
- AI agents and RAG pipelines that need page-cited chunks and real tables instead of a wall of text. Call it through the Apify MCP server (see below) and index the
chunksarray as is. - Data teams turning recurring PDF reports into rows: statistical releases, price lists, schedules, invoices with a text layer.
- Finance and research analysts pulling tables out of filings, central bank releases and research reports, with coordinates to verify every number against the page.
- Compliance and legal teams that must quote a page and position, not just a document.
- Anyone who needs PDF to Markdown or OCR PDF to text for a handful of pages without installing anything.
Quick start
- Open the Actor in Apify Console and press Start. The default input parses a public Federal Reserve statistical release (12 pages, several tables) in a few seconds.
- Replace the URL with your own PDF link. Use
pageslike"1-5,8"to parse only what you need. - For scanned PDFs set
ocrtoauto(mixed documents) oralways(fully scanned). - For one JSON object per file set
outputModetodocuments. - Read results from the default dataset (JSON, CSV or Excel) or the API:
https://api.apify.com/v2/datasets/<datasetId>/items. TheSUMMARYrecord in the key-value store lists every file's status, pages processed and charged, OCR pages and errors.
Input example
{"pdfUrls": ["https://www.federalreserve.gov/releases/h41/current/h41.pdf"],"pages": "1-3","outputMode": "pages","extractTables": true,"markdown": true,"chunkSize": 1200,"chunkOverlap": 150,"ocr": "off","includeCellBoxes": false}
All fields are optional. A run with no input parses the Federal Reserve release above.
| Field | Type | Default | Meaning |
|---|---|---|---|
pdfUrls | array of strings | one sample PDF | Public http(s) links to PDF files, up to 100 |
pdfUrl | string | empty | Shortcut for a single URL, merged into pdfUrls |
pages | string | all | 1-based pages like "1-5,8" or "3-" |
maxPagesPerPdf | integer 1 to 1000 | 50 | Cap on pages processed and charged per file |
outputMode | pages or documents | pages | One item per page, or one per PDF |
extractTables, extractText, markdown | booleans | true | Turn parts of the output off |
chunkSize | integer | 1200 | Chunk size in characters, 0 disables chunks |
chunkOverlap | integer | 150 | Characters shared by consecutive chunks |
ocr | off, auto, always | off | When to run OCR |
ocrLanguage | string | eng | Tesseract language, only English is installed |
maxFileSizeMb | integer 1 to 200 | 50 | Larger files are skipped with an error item |
includeWordBoxes | boolean | false | Add every word with its box to each page |
includeCellBoxes | boolean | false | Add a box for every table cell |
Output example
One page item from the default run (page 2 of the Federal Reserve H.4.1 release; text, markdown, rows and chunks are shortened here):
{"sourceUrl": "https://www.federalreserve.gov/releases/h41/current/h41.pdf","documentId": "6cb2cd9838d643a55fd6591794268e74e7b0224d","fileName": "h41.pdf","page": 2,"pageCount": 12,"width": 612,"height": 792,"text": "FEDERAL RESERVE statistical release\nH.4.1\nFactors Affecting Reserve Balances of Depository Institutions and\nCondition Statement of Federal Reserve Banks\nOctober 22, 2026\n1. Factors Affecting Reserve Balances of Depository Institutions\nMillions of dollars\n...","markdown": "## FEDERAL RESERVE statistical release\n\nH.4.1\n\n## Factors Affecting Reserve Balances of Depository Institutions and\n\n...\n\n| Averages of daily figures | | |\n| --- | --- | --- |\n| Oct 21, 2026 | Oct 14, 2026 | Oct 22, 2025 |\n| 6,706,861 | - 789 | + 161,908 |\n...","tables": [{"tableIndex": 0,"page": 2,"bbox": [251.75, 173.27, 503.75, 519.23],"rowCount": 33,"columnCount": 3,"header": ["Averages of daily figures", "", ""],"rows": [["Averages of daily figures", "", ""],["", "Change from week ended", ""],["Week ended", "", ""],["Oct 21, 2026", "Oct 14, 2026", "Oct 22, 2025"],["6,706,861", "- 789", "+ 161,908"],["6,470,860", "+ 492", "+ 187,540"]],"markdown": "| Averages of daily figures | | |\n| --- | --- | --- |\n...","strategy": "lines+text"}],"chunks": [{"chunkIndex": 0,"page": 2,"charStart": 0,"charEnd": 608,"text": "FEDERAL RESERVE statistical release\nH.4.1\n...","citation": { "type": "page", "page": 2, "label": "p. 2" }},{"chunkIndex": 1,"page": 2,"charStart": 460,"charEnd": 1659,"text": "...","citation": { "type": "page", "page": 2, "label": "p. 2" }},{"chunkIndex": 2,"page": 2,"charStart": 1509,"charEnd": 2103,"text": "...","citation": { "type": "page", "page": 2, "label": "p. 2" }}],"ocrUsed": false,"charCount": 2103,"warnings": [],"extractedAt": "2026-10-23T05:39:57.921Z"}
With includeCellBoxes: true each table also has "cells": [{"row": 4, "col": 0, "text": "6,706,861", "bbox": [251.75, 208.93, 337.25, 217.95]}, ...].
Coordinates are PDF points (1/72 inch) with the origin at the top-left corner of the page; width and height give the page size in the same unit, so dividing by them yields relative positions for any viewer.
In documents mode the item has pageCount, pagesProcessed, pages, metadata (title, author, creator, producer, creationDate), text (pages joined with \f), markdown, tables (all pages, each with page), chunks (all pages, each with page), ocrPagesUsed, charCount, warnings and extractedAt.
Family: the same chunks for PDFs and recordings
This Actor has a sibling, transcribe-to-json-chunks, which turns audio and video (MP3, WAV, M4A, MP4, MOV, WebM and more) into the exact same chunk schema with time citations instead of page citations. Both emit:
{ "chunkIndex": 0, "text": "...", "charStart": 0, "charEnd": 1187, "citation": { "type": "page", "page": 3, "label": "p. 3" } }{ "chunkIndex": 0, "text": "...", "charStart": 0, "charEnd": 1187, "citation": { "type": "time", "startMs": 723000, "endMs": 768000, "label": "00:12:03-00:12:48" } }
So one ingestion pipeline can index chunks[].text with citation.label as the display reference, whether the source was a 40-page report or a 40-minute meeting recording. The chunker is the same code in both Actors (sentence-aligned, character-sized, with overlap), so chunk boundaries behave the same way too.
Pricing in plain words
Pay per page, nothing else: $0.003 per page processed (the page-processed event), plus $0.01 per page only when OCR actually ran on it (the ocr-page event), plus Apify's standard tiny Actor start fee. A 30-page report costs 9 cents; fully OCR'd it costs 39 cents. Both output modes charge per processed page. Failed downloads and unreadable PDFs are never charged. You set the maximum you are willing to spend per run; when the limit is reached the Actor stops parsing and still finishes successfully, and the SUMMARY record says so. Platform compute is included in the price.
Limits
- File size: 50 MB per PDF by default (
maxFileSizeMb, up to 200). Up to 100 URLs per run. - Pages: 50 per PDF by default (
maxPagesPerPdf, up to 1000).pageCountalways shows the true total. - Text-layer PDFs only unless you turn OCR on. A scanned PDF returns empty text with
ocr: "off"; useautooralways. OCR takes about 2 to 3 seconds per page and is English only (eng) in this build. - Encrypted or password-protected PDFs are not supported and return an
encryptederror item. - Table detection is heuristic. Ruled tables are reliable. Tables drawn only with whitespace are found when they look like data (mostly numbers, dense); text-only tables without lines may be missed, and caption lines directly above an unruled table can be absorbed as a first row. Where a ruled table has sub-columns without lines, those values stay together in one cell. Check
strategyandbboxwhen quality matters. - Reading order follows the PDF's own layout; multi-column articles are read left to right by line, as most parsers do.
- URLs must be public. Pages behind a login (HTTP 401) or a bot wall (HTTP 403) return an error item; upload such files to storage you control (for example an Apify key-value store) and pass that URL.
- Runs are stateless. PDFs are fetched from the URLs you provide, parsed in memory and on the run's disk, and deleted when the run ends. Only the JSON you see in the dataset is kept.
Use it from an AI agent (Apify MCP server)
Connect your agent to https://mcp.apify.com (see the Apify MCP docs for Claude, Cursor, VS Code and others). Then:
- Search for the tool:
search-actorswith the query "pdf to json" or "pdf table extraction". - Read the schema:
fetch-actor-detailsfor this Actor returns the input fields above and the dataset schema. - Call it:
call-actorwith{"pdfUrls": ["https://example.com/report.pdf"]}, or{"pdfUrls": ["..."], "pages": "1-10", "outputMode": "documents"}for one object per file, or{"pdfUrls": ["..."], "ocr": "auto"}when some pages may be scanned. - Read results with
get-dataset-items. Indexchunks[].textwithpage,charStartandcharEndas metadata; feedtables[].rowsstraight into a dataframe.
The Actor runs with limited permissions and charges only pay-per-event events, so it works with Apify's agentic payments.
Open-source credits and licenses
Everything inside is permissively licensed. No copyleft components are used or bundled.
| Component | Role | License |
|---|---|---|
| pdfplumber | Text, words, characters and table detection | MIT |
| pdfminer.six | PDF parsing engine under pdfplumber | MIT |
| pypdfium2 (PDFium) | Page rendering for OCR | BSD-3-Clause or Apache-2.0 |
| Pillow | Image handling for OCR | MIT-CMU (HPND) |
| pytesseract | Python bridge to Tesseract | Apache-2.0 |
Tesseract OCR with the eng model | OCR engine | Apache-2.0 |
| Apify SDK for JavaScript, got-scraping | Actor runtime and downloads | Apache-2.0 / MIT |
Base image apify/actor-node:22 (Node.js on Alpine Linux) | Runtime | MIT / various permissive |
Python dependencies pulled in transitively (cffi, pycparser, cryptography, charset-normalizer, packaging) are MIT, BSD or Apache licensed. The Actor's own code is Apache-2.0.
FAQ
Does it work on scanned PDFs? Yes, set ocr to auto (mixed documents) or always (fully scanned). OCR pages cost $0.01 extra each. Only English OCR is installed today.
Why did a table come back with the row labels missing? When a PDF draws ruled boxes around the numbers but prints the labels outside the box, the label column is not part of the ruled table. The labels are still in text and markdown, and the table's bbox tells you where it sits on the page.
Can I get the position of every cell? Yes, set includeCellBoxes: true. Each table then carries cells: [{row, col, text, bbox}].
One item per page or one per document? outputMode: "pages" (default) gives one dataset item per page, which is the natural unit for RAG. outputMode: "documents" gives one item per PDF with every table and chunk tagged with its page.
Are my PDFs stored? No. Each file is downloaded from the URL you give, parsed, and deleted when the run ends. Results live in your own dataset.
What does it cost? $0.003 per page processed, plus $0.01 per page only when OCR runs. A 30-page report with a text layer costs 9 cents.
Where do recordings fit? The sibling Actor transcribe-to-json-chunks returns the same chunk schema with time citations. Working pipelines for both are in the rag-ingestion-examples repository.
Support
Open an issue on the Actor's Issues tab in Apify Console. Include the run id, the PDF URL (if you can share it) and the input you used.