What it does
A scanned PDF is just a stack of pictures. Search boxes, LLMs and full-text indexes see nothing inside it until each page has been run through OCR. The PDF OCR actor does that for you in the cloud: paste links to archive scans, faxes, signed contracts, invoices or photocopied letters, and it returns the text of each page with line and paragraph breaks kept.
Many real PDFs are mixed: a digital report with a few scanned appendix pages, or a contract where only the signature pages were scanned. In the default auto mode the actor reads pages that already have a text layer directly (exact, and charged at $0.30 per 1,000 pages) and only OCRs the pages that are images (charged at $3 per 1,000 pages). You do not pay OCR prices for text that was already there.
Recognition runs on Tesseract 5 with its LSTM models in 29 languages, up to 4 per run. Every OCR'd page carries a confidence score, so you can spot the pages worth a human look, and optional word-level bounding boxes help with redaction and highlighting. It suits records teams digitising archives, developers adding a PDF OCR step to an app, and anyone feeding paper documents into a RAG pipeline.
How it works
- You pass one or more PDF links in
urls(images such as PNG, JPEG and TIFF are accepted too). - Each PDF is opened page by page; in
automode, pages with an existing text layer are read directly and the rest are rendered at the chosendpi(300 by default). - Rendered pages are recognised by Tesseract 5 in the languages you selected, with an optional page segmentation mode for forms or receipts.
- Results are written as one row per page (the default for this actor) or one row per PDF, with text, word count, OCR confidence and page counts by method.
- Failed downloads, unreadable files and blank pages are reported but not charged, and the run stops cleanly at your maximum total charge.
Input example
A typical run input (JSON). Every field is also available as a form in the Apify console.
{
"urls": [
"https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/linn.pdf",
"https://arxiv.org/pdf/1706.03762"
],
"languages": [
"eng"
],
"pdfMode": "auto",
"outputMode": "pages",
"dpi": 300,
"maxPagesPerPdf": 200
}All input fields
| Field | Type | Required | Default | What it does |
|---|---|---|---|---|
urls | array | yes | Links to scanned or mixed PDFs (each page is OCR'd unless it already has a text layer). Images (PNG, JPEG, TIFF, WebP) work too. | |
languages | array | no | ["eng"] | Languages in the documents (up to 4). Picking only the languages you need is faster and more accurate. |
pdfMode | string | no | "auto" | Auto: pages that already contain text are read directly (exact, and charged at the cheaper text-layer price); only scanned pages are OCR'd. OCR all: OCR every page, e.g. when a PDF's hidden text layer is poor. |
outputMode | string | no | "pages" | For PDFs: one row per PDF with all pages, or one row per page. Images are always one row each. |
includeWords | boolean | no | false | Add every recognised word with its confidence and pixel box (left, top, width, height), e.g. for redaction, highlighting or form extraction. |
minWordConfidence | integer | no | 0 | Drop words Tesseract is less sure of than this (0–100). 0 keeps everything; 40–60 removes most noise from stains and stamps. |
pageSegmentation | string | no | "auto" | How Tesseract finds text. Auto suits most pages; Single column for uniform text; Single block for receipts and snippets; Sparse for scattered text like forms and screenshots. |
dpi | integer | no | 300 | Resolution scanned PDF pages are rendered at before OCR. 300 is the accuracy sweet spot; 200 is faster for large print. |
maxPagesPerPdf | integer | no | 200 | Process at most this many pages of each PDF (from the start). Longer PDFs are marked truncated. |
maxFiles | integer | no | 1000 | Stop after this many files. |
password | string | no | For password-protected PDFs you are entitled to open. Used for every PDF in the run. |
Output example
Below, a scanned brochure is OCR'd (one OCR page, 95.5 confidence) while a digital paper is read from its text layer with no OCR at all.
| url | fileType | pagesOcr | confidence | wordCount | text | pagesTextLayer |
|---|---|---|---|---|---|---|
| https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/linn.pdf | 1 | 95.5 | 728 | The LinnSequencer\n32 Track MIDI Sequence Recorder\n\nThe LinnSequencer is a state-of-the-art composition and performance tool… | ||
| https://arxiv.org/pdf/1706.03762 | 0 | 6457 | Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures… | 15 |
Pricing
Pay per event: you are charged only for the results you receive, with no subscription. Set a maximum total charge on any run and it stops cleanly at the cap.
| Charged for | When | Price | Per 1,000 | Worked example |
|---|---|---|---|---|
| Page ocr | Charged per image or scanned PDF page read by OCR | $0.003 | $3 | A 10-page scanned PDF = $0.03; 1,000 receipts = $3.00 |
| Page text | Charged per PDF page that already has a text layer (read directly, no OCR) | $0.0003 | $0.30 | A 100-page digital PDF = $0.03 |
| Actor Start (platform start fee) | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). | $0.00005 | — | One run at 4 GB = $0.0002 |
Prices are read from the live Apify Store listing when this page is built. The listing is always authoritative.
Try PDF OCR on Apify. Pay only for the results you get.
Run on Apify →Use cases
Make a scanned archive searchable
Run a folder of digitised letters, minutes or old reports through the actor and index the returned text in your search engine. The per-page rows map cleanly onto page-level search hits, so users land on the right page of the original scan.
Review signed contracts and invoices
Signed agreements and supplier invoices often come back as scans. OCR them to text so you can search for clauses, amounts and party names, and use the confidence score to route weak pages to manual review.
Process mixed digital and scanned PDFs
When a batch contains both born-digital PDFs and scans, auto mode reads the digital pages exactly at the text-layer price and only OCRs the image pages. Use ocr-all only when a PDF's hidden text layer is known to be poor.
Feed paper documents to an LLM
Turn scanned reports into plain text that a RAG pipeline or AI agent can chunk and embed. If you need Markdown with headings for digital PDFs as well, see Any URL to Markdown.
How it compares
| ActorForge PDF OCR | Self-hosted Tesseract | Desktop PDF editor OCR | |
|---|---|---|---|
| Setup | None, paste links or call the API | Install Tesseract, language packs and a PDF renderer | Install and open each file |
| Skips pages that already have text | Yes, at the cheaper text-layer price | Only if you script it | Partial, depends on the tool |
| Per-page confidence score | Yes | Yes, if you read it from Tesseract output | Usually not exposed |
| Batch via API / automation | Yes | Yes, with your own code | No or limited |
| Software cost | $3 per 1,000 OCR pages | Free (you pay for servers and time) | Licence fee |
| Handwriting and complex tables | Weak: tables come out as lines of text | Same engine, same limits | Varies by product |
| Files stay on your machine | No, files are fetched from URLs | Yes | Yes |
If you already run Tesseract on your own servers, or your documents must never leave your network, self-hosting is the better fit. This actor is for teams who want the same engine without maintaining it, with text-layer detection and billing per page built in.
Limits and honest notes
- Tesseract reads printed and typed text very well (95%+ confidence on clean scans); handwriting, low-resolution photos, heavy stamps and decorative fonts come out poorly. The confidence score tells you which pages to check.
- Output is plain text in reading order with line and paragraph breaks. Tables come out as lines of text, not structured tables. Images and charts have no text to extract.
- Pages rotated by 90° or 180° are not auto-rotated; slightly skewed scans are fine.
- Up to 4 languages per run; picking only the languages your documents use is faster and more accurate. Modern Greek is not available.
- HEIC/AVIF photos and SVG are not supported (convert photos to JPEG). Files up to 100 MB; PDFs up to 2,000 pages each (200 by default).
- Password-protected PDFs need the password input. Links that return a web page instead of a file are reported and not charged.
- Respects your run budget: set a maximum total charge and processing stops cleanly at the cap, with no page charged twice.
FAQ
How do I make a scanned PDF searchable with an API?
Send the PDF's URL in urls and the actor returns the recognised text for each page. Store that text in your search index alongside the original file. The actor returns text, not a new PDF with an embedded text layer.
Will I pay OCR prices for pages that already contain text?
No, not in the default auto mode. Pages with a text layer are read directly and charged at $0.0003 per page; only image pages are OCR'd at $0.003 per page. Switch pdfMode to ocr-all only if a PDF's existing text layer is broken.
Can it OCR password-protected PDFs?
Yes, if you are entitled to open them. Put the password in the password field; it is used for every PDF in that run, so group files that share a password into one run.
What happens with sideways or upside-down scans?
Pages rotated by 90 or 180 degrees are not auto-rotated, so rotate them before submitting. Slightly skewed scans are handled fine.
How long can a PDF be?
Files up to 100 MB and up to 2,000 pages per PDF are supported. By default only the first 200 pages of each PDF are processed; raise maxPagesPerPdf for longer documents. Longer PDFs are marked as truncated.
Use it from code
Run the actor through the Apify API with the input above.
cURL
curl -X POST "https://api.apify.com/v2/acts/actor-forge~pdf-ocr/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/linn.pdf", "https://arxiv.org/pdf/1706.03762"], "languages": ["eng"], "pdfMode": "auto", "outputMode": "pages", "dpi": 300, "maxPagesPerPdf": 200}'JavaScript (Node.js)
// Node.js 18+ (built-in fetch). Set APIFY_TOKEN in your environment.
const input = {
"urls": [
"https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/linn.pdf",
"https://arxiv.org/pdf/1706.03762"
],
"languages": [
"eng"
],
"pdfMode": "auto",
"outputMode": "pages",
"dpi": 300,
"maxPagesPerPdf": 200
};
const res = await fetch(
"https://api.apify.com/v2/acts/actor-forge~pdf-ocr/run-sync-get-dataset-items",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.APIFY_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify(input),
}
);
const items = await res.json();
console.log(items.length, items[0]);Python
# pip install apify-client (set APIFY_TOKEN in your environment)
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run_input = {
"urls": [
"https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/linn.pdf",
"https://arxiv.org/pdf/1706.03762"
],
"languages": [
"eng"
],
"pdfMode": "auto",
"outputMode": "pages",
"dpi": 300,
"maxPagesPerPdf": 200
}
run = client.actor("actor-forge/pdf-ocr").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)The run-sync-get-dataset-items endpoint waits for the run (up to 5 minutes) and returns the dataset rows directly. For longer runs, start the run asynchronously and read the dataset when it finishes, as the Python example does. Replace APIFY_TOKEN with your own token from the Apify console.
Step-by-step guides
How to Convert PDF to Markdown for RAG Pipelines
Send your PDF links to the Any URL to Markdown actor, read the markdown field of each result, then split it by heading into token-sized chunks…
How to OCR Scanned PDFs to Text with an API
Send scanned PDF links to the PDF OCR actor, get text back one row per page with a confidence score, and use that score to flag pages for review.…
Related actors
OCR — Scanned PDF & Image to Text (Tesseract, 29 Languages)
Extract text from scanned PDFs and images (PNG, JPEG, TIFF, WebP, GIF, BMP) with Tesseract 5 OCR in 29 languages. PDF pages that already have text…
$3 per 1,000 · page ocrImage to Text OCR — Extract Text from Photos & Screenshots
Extract text from images (PNG, JPEG, TIFF, WebP, GIF, BMP) with Tesseract 5 OCR in 29 languages: screenshots, photos of documents, receipts, scans…
$3 per 1,000 · page ocrAny URL to Markdown — Web Pages, PDF, Word, Excel & OCR
Turn any URL into clean, LLM-ready Markdown: web pages, PDFs, Word, Excel, PowerPoint, EPUB, CSV and JSON, plus OCR for images and scanned PDFs. One…
$1 per 1,000 · page resultTry PDF OCR on Apify. Pay only for the results you get.
Run on Apify →