PDF Text Extractor & OCR: Text, Markdown & RAG Chunks avatar

PDF Text Extractor & OCR: Text, Markdown & RAG Chunks

Pricing

from $3.00 / 1,000 pdf extracteds

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

PDF Text Extractor & OCR: Text, Markdown & RAG Chunks

Extract text from PDFs, including scanned PDFs with built-in OCR in 19 languages. Get clean text, Markdown with headings, per-page text, metadata and RAG-ready chunks. Paste PDF links, or a web page and every linked PDF is extracted. $3 per 1,000 PDFs, OCR $0.005 per scanned page.

Pricing

from $3.00 / 1,000 pdf extracteds

Rating

0.0

(0)

Developer

Digitální produkty pro život

Digitální produkty pro život

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

20 days ago

Last modified

Share

PDF Text Extractor: Text, Markdown, OCR & RAG Chunks

Turn any PDF into clean, structured text, including scanned PDFs (built-in OCR). Paste links to PDF files, or just paste a web page (a reports, downloads or documents page) and every PDF linked from it is found and extracted for you.

You get plain text, Markdown with headings and bullet lists, document metadata, optional text per page and optional RAG-ready chunks for embeddings and vector databases.

What you get for each PDF

FieldExample
url, fileName, sourcePagewhere the PDF came from
title, author, subject, keywordsfrom PDF metadata (title falls back to the biggest heading)
createdAt, modifiedAtISO dates
pageCount, pagesExtracted, wordCount, charCountsize of the document
textclean text with paragraphs
markdownheadings (#, ##, ###) detected from font sizes, bullet lists, joined hyphenated words
pages[{ page, text }] when Text per page is on, great for citations
chunkstext split on paragraph and sentence boundaries when RAG chunk size is set
ocrPages, ocrLanguagewhich pages were read by OCR (only present for scanned pages)

A run summary with every skipped file and the reason is saved to the SUMMARY record.

Scanned PDFs (OCR)

Many PDFs are just scanned images: invoices, contracts, old reports, faxes, book scans. They have no text layer, so normal extractors return nothing.

With OCR for scanned pages = Auto (the default) the Actor checks every page:

  • pages that already have text are extracted directly (fast, no OCR cost),
  • pages without text are rendered at 300 DPI and read with Tesseract OCR,
  • hybrid PDFs (some pages typed, some scanned) are handled page by page.

Set OCR languages for non-English documents (e.g. de, fr, en, cs). 19 languages are included: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Czech, Slovak, Swedish, Danish, Norwegian, Finnish, Romanian, Hungarian, Turkish, Russian and Ukrainian. Use Always to re-read PDFs whose text layer is broken (garbled characters), and Max OCR pages per PDF as a cost guard.

Tip: OCR is CPU-heavy. For large scans run with 4 GB memory: it is about 4x faster and costs about the same.

Tutorial: turn a scanned PDF into text (tested example)

A scanned PDF has no text layer, so pdftotext and most extractors return an empty string. Here is a real run on a public one-page scan from the OCRmyPDF test files (run on October 13, 2026):

from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("digitalni.produkty.pro.zivot/pdf-text-extractor").call(run_input={
"urls": ["https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/skew.pdf"],
"ocrMode": "auto", # OCR only pages without a text layer
"ocrLanguages": "eng", # e.g. "de", "fr, en", "cs"
"includePages": True, # text per page, useful for citations
})
doc = next(client.dataset(run["defaultDatasetId"]).iterate_items())
print(doc["ocrPages"], doc["wordCount"]) # [1] 693
print(doc["text"][:60]) # The LinnSequencer / 32 Track MIDI Sequence Recorder

What happened: the page had no text layer, the Actor rendered it at 300 DPI, read it with Tesseract and returned 693 words with paragraphs and bullet points, even though the scan is slightly skewed. The run took about 9 seconds.

Cost of this example: $0.003 for the PDF + $0.005 for one OCR page = $0.008. A 10-page scanned contract costs $0.053; 1,000 typed (not scanned) PDFs cost $3.

Limits for scanned PDFs, to be fair:

  • Quality depends on the scan. Clean 200-300 DPI scans give near-perfect text; phone photos of paper, handwriting, stamps and very small print come out much weaker, and OCR errors (wrong letters, merged words) are possible.
  • Tables are returned as lines of text, not as cells. Multi-column scans may mix columns.
  • Set the right language: an English model reading a German or Czech scan loses accents and makes more mistakes.
  • Use Max OCR pages per PDF as a cost cap for very long scanned books.

Use cases

  • LLM and RAG pipelines: feed reports, manuals and papers into ChatGPT, Claude or a vector database as Markdown or ready-made chunks.
  • Monitor document pages: extract all annual reports, tenders, price lists or policies linked from a company page, and schedule the run.
  • Research: bulk-extract scientific papers (arXiv and others) with titles and page counts.
  • Search and archiving: make PDF libraries full-text searchable.
  • Scanned paperwork: turn scanned invoices, contracts and archive documents into text for search, accounting or an LLM.

How to use

  1. Add PDF links or web page links to PDF or page URLs.
  2. Optional: turn on Text per page, set RAG chunk size (e.g. 1000) or limit Max pages per PDF.
  3. Run and download the results as JSON, CSV, Excel or via API.

Example input

{
"urls": ["https://arxiv.org/pdf/1706.03762", "https://www.irs.gov/forms-pubs/about-form-w-9"],
"chunkSize": 1000,
"includePages": true
}

Example output (shortened)

{
"url": "https://arxiv.org/pdf/1706.03762",
"title": "Attention Is All You Need",
"pageCount": 15,
"wordCount": 6225,
"createdAt": "2024-04-10T21:11:43.000Z",
"markdown": "# Attention Is All You Need\n\nAshish Vaswani ...\n\n### Abstract\n\nThe dominant sequence transduction models ...",
"chunks": ["Attention Is All You Need ...", "..."]
}

Pricing

You pay only for successfully extracted PDFs, no matter how many pages they have:

  • $3 per 1,000 PDFs ($0.003 per PDF, any number of pages),
  • $0.005 per scanned page read by OCR, charged only for pages without a text layer where OCR found text. Pages with a normal text layer never pay it.

Example: 1,000 normal PDFs cost $3. A 10-page scanned contract costs $0.003 + 10 x $0.005 = $0.053.

Failed downloads, broken files, password-protected files without a password and blank scans are never charged. See the Pricing tab for the current price.

Limits and notes

  • OCR quality depends on the scan: clean 200-300 DPI scans give near-perfect text, photos of paper, handwriting and very small print are much weaker. Tables are returned as text lines, not as table cells.
  • Password-protected PDFs work when you enter the password.
  • Files above Max file size (default 50 MB) are skipped.
  • Multi-column layouts follow the reading order stored in the PDF, which is correct for most documents.
  • Only process documents you are allowed to access and use.

Questions or ideas?

Open an issue on the Issues tab. Feature requests are welcome and usually answered within a day or two.

How to use it via API

You can run the Actor from the Apify Console, on a schedule, or from your own code. Get your API token in Apify Console → Settings → Integrations.

Python

from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("digitalni.produkty.pro.zivot/pdf-text-extractor").call(run_input={
"urls": [
"https://arxiv.org/pdf/1706.03762"
],
"includeMarkdown": True,
"chunkSize": 1000
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)

JavaScript / Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('digitalni.produkty.pro.zivot/pdf-text-extractor').call({
"urls": [
"https://arxiv.org/pdf/1706.03762"
],
"includeMarkdown": true,
"chunkSize": 1000
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Integrations and AI agents

  • Export results as JSON, CSV, Excel, XML or HTML, or open them directly in Google Sheets.
  • Connect to Make, Zapier, n8n, Slack, Google Drive, Airbyte or any webhook to get text, Markdown and RAG chunks from PDFs into your workflow automatically.
  • Use it from AI agents and LLM apps (Claude, ChatGPT, Cursor, LangChain…) through the Apify MCP server: the agent can call this Actor as a tool.
  • Schedule runs (hourly, daily, weekly) to keep data fresh without any code.

FAQ

How much does it cost? $0.003 per successfully extracted PDF, regardless of page count. 1,000 PDFs cost $3. Scanned pages read by OCR cost $0.005 per page extra (a 10-page scanned contract = $0.053). Failed and skipped files are free.

Does it do OCR on scanned PDFs? Yes. Pages without a text layer are read automatically with Tesseract OCR in 19 languages. Pages that already contain text are never OCR'd, so typed PDFs stay fast and cheap.

Can I OCR only some pages? Use Max pages per PDF (first N pages) and Max OCR pages per PDF (cost guard). Turn OCR Off to skip scans completely.

Can I use it for RAG / LLM pipelines? Yes. Set a RAG chunk size (and overlap) and load the dataset straight into LangChain, LlamaIndex or a vector database through the Apify API.

Can it find PDFs on a web page? Yes. Give a page URL and every linked PDF is discovered and extracted.

More tools from the same developer

All tools with code examples: github.com/Phenixik/apify-actors

Need a custom tool? I build custom Apify Actors, scrapers, data feeds and automations, and adapt existing Actors to your workflow. Write to digitalniproduktyprozivot@email.cz or open an issue on the Issues tab.