PDF Text Extractor — Markdown, Tables, OCR & RAG Chunks avatar

PDF Text Extractor — Markdown, Tables, OCR & RAG Chunks

Pricing

from $4.00 / 1,000 pdf processeds

Go to Apify Store
PDF Text Extractor — Markdown, Tables, OCR & RAG Chunks

PDF Text Extractor — Markdown, Tables, OCR & RAG Chunks

Extract text, GFM Markdown, tables (2D arrays + CSV) and heading-aware RAG chunks with page anchors from PDFs. URLs, base64 upload, key-value store, password-protected PDFs, page ranges, OCR fallback (eng/deu/fra/spa) only for pages without a text layer. Failed PDFs are never charged.

Pricing

from $4.00 / 1,000 pdf processeds

Rating

0.0

(0)

Developer

Leonardo Berisha

Leonardo Berisha

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

PDF text extractor that turns any PDF into clean plain text, GitHub-flavored Markdown, structured tables (2D arrays + CSV) and — unique on Apify — heading-aware RAG chunks with page anchors, ready for your vector database. Feed it URLs, base64 uploads or key-value store files; encrypted PDFs and page ranges are supported, and scanned pages are recovered via OCR fallback (English, German, French, Spanish) — you only pay OCR for pages that actually have no text layer. Failed PDFs are never charged.

What is PDF Text Extractor — Markdown, Tables, OCR & RAG Chunks?

It is one actor that replaces four: a PDF-to-text converter, a PDF-to-Markdown API, a PDF table extractor and a RAG chunking pipeline.

  • Plain text — word-spacing-safe extraction (handles tight LaTeX/arXiv kerning that glues words together in naive extractors)
  • Markdown (GFM) — headings inferred from font sizes, paragraphs merged across line breaks, tables embedded as pipe tables
  • Tables — detected per page, returned as 2D arrays and ready-made CSV strings with page numbers
  • RAG chunks — the differentiator: ~chunkTokens-sized chunks that break at headings, each carrying headingPath (e.g. ["Attention Is All You Need", "3 Model Architecture"]), pageStart/pageEnd for citations, and a token estimate. No other PDF actor ships this
  • OCR fallback — Tesseract runs only on pages without a text layer (eng, deu, fra, spa), capped by maxOcrPages
  • Every input channel — public URLs, inline base64 (also data: URIs), Apify key-value store keys; password-protected PDFs; page ranges like 1-5,8,12-
  • info mode (free) — page count, metadata, encryption status, how many pages would need OCR and the exact cost estimate before you spend anything
  • canary mode (free) — six-point self-test (parser, metadata, tables, download, OCR engine, chunker) so you can verify health before relying on it

Input

{
"mode": "extract",
"urls": ["https://arxiv.org/pdf/1706.03762"],
"pageRange": "1-5,8,12-",
"ocrLanguages": ["eng", "deu"],
"outputFormats": ["text", "markdown", "tables", "chunks"],
"chunkTokens": 800
}

Or upload inline: "base64Files": [{"name": "report.pdf", "data": "<base64>"}], or reference a key-value store record: "keyValueStoreKeys": ["my-upload"]. Encrypted files: add "password": "...".

Output

One dataset item per PDF:

{
"source": "url",
"url": "https://arxiv.org/pdf/1706.03762",
"fileName": "1706.03762",
"status": "success",
"pageCount": 15,
"metadata": { "title": "...", "producer": "pdfTeX", "encrypted": false },
"text": "Attention Is All You Need\n\nAshish Vaswani ...",
"markdown": "# Attention Is All You Need\n\n### 1 Introduction\n\nRecurrent neural networks ...",
"tables": [{ "page": 9, "rows": [["Model", "BLEU"], ["Transformer (big)", "28.4"]], "csv": "Model,BLEU\n..." }],
"chunks": [{
"index": 3,
"text": "### 3 Model Architecture\n\nMost competitive neural sequence transduction models ...",
"tokenEstimate": 720,
"headingPath": ["Attention Is All You Need", "3 Model Architecture"],
"pageStart": 2,
"pageEnd": 4
}],
"ocrPagesUsed": [],
"charCount": 35539,
"wordCount": 6204,
"processingMs": 9932
}

status is success, partial (some pages failed or OCR budget ran out — details in notes), failed (never charged) or skipped (your cost limit was reached).

Pricing

Pay per event — you only pay for delivered results:

EventPrice
Actor start$0.002
PDF processed (text + markdown + tables + chunks)$0.004
OCR page (only pages without a text layer)$0.008

10 regular PDFs cost $0.042. A fully scanned 20-page document costs $0.166. Compare: Unstructured.io charges $0.03 per page; other Apify PDF actors charge up to $0.02 per PDF and $0.015 per OCR page — and none of them outputs RAG chunks. Failed PDFs are free, info and canary runs are free (start fee only).

Use with AI agents (MCP), n8n, Make & Zapier

Every mode works through the Apify MCP server — point Claude, ChatGPT, LangGraph or CrewAI at Apify and the agent can call this actor directly, e.g. "extract the tables from this PDF and give me heading-aware chunks for retrieval". The input schema is agent-friendly by design: one mode switch, no required fields beyond the file itself, sensible defaults, and the free info mode lets an agent estimate cost before committing. The same applies to the Apify integrations for n8n, Make and Zapier — batch-convert PDFs to Markdown in a no-code pipeline without hosting your own parser.

FAQ

Is this legal? Yes. The actor only processes PDFs you explicitly provide (your URLs, your uploads, your storage). It uses open-source extraction libraries (pdfplumber, pypdf, Tesseract), collects no personal data and scrapes nothing on its own.

How is this different from other PDF text extractors? Three things in one actor that competitors split or skip: (1) tables as structured data plus Markdown, (2) every input channel incl. base64 upload and password PDFs, (3) heading-aware RAG chunks with page anchors — the format vector databases and citation-grounded RAG actually need.

Does OCR run on every page? No. OCR runs only on pages whose text layer is empty (true scans). Pages with digital text are extracted natively and never billed as OCR. Set maxOcrPages: 0 to disable OCR entirely.

What about scanned PDFs in German, French or Spanish? Pass "ocrLanguages": ["deu"] (or fra/spa, combinable with eng). The language packs ship inside the actor image.

Can I extract only specific pages? Yes — "pageRange": "1-5,8,12-" (1-based, open ranges allowed).

How do I estimate cost before running a big batch? Run mode: "info" first (free): it reports per document how many pages lack a text layer and the exact extraction price.

What happens when my cost limit is reached mid-run? The actor stops charging, marks remaining PDFs as skipped and finishes gracefully — you never pay above your maxTotalChargeUsd.

Is my data safe? Files are processed in an isolated container with limited permissions and are not persisted anywhere except your own dataset output.

Keywords

pdf text extractor, pdf to markdown api, extract tables from pdf, pdf parser for RAG, rag chunking pdf, pdf ocr api, scanned pdf to text, batch pdf processing, pdf to json, LLM document extraction, pdf chunking for vector database, langchain pdf loader alternative, password protected pdf extraction, pdf table to csv, heading aware chunking, MCP pdf tool, n8n pdf extraction, make.com pdf parser