# Scanned PDF OCR to Text & Markdown (`steady-scrape/pdf-ocr-scanned`) Actor

OCR scanned and image-only PDFs into plain text and Markdown with per-page confidence. Pages that already have a text layer are read directly. Blank, unreadable and failed pages are free.

- **URL**: https://apify.com/steady-scrape/pdf-ocr-scanned.md
- **Developed by:** [SteadyScrape](https://apify.com/steady-scrape) (community)
- **Categories:** Developer tools, Automation, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.60 / 1,000 ocr pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Scanned PDF OCR to Text & Markdown

Turn **scanned and image-only PDFs** into clean plain text and Markdown. Each page is rendered and read with an OCR engine that runs inside the Actor, so your documents are not sent to a third-party AI service. Pages that already contain a real text layer are read directly (faster, and charged at a lower rate).

**Who it's for:** Teams that need text from scans, filings, invoices and archives, or a mixed batch that includes both digital and scanned PDFs.

**Price:** $0.008 per readable OCR page + $0.001 per text-layer page + $0.002 once per run, charged only if at least one page is readable. Blank, low-confidence, failed and timed-out pages are free. A 10-page scan in one run = **$0.082**.

Pairs with [PDF to Text / Markdown](https://apify.com/steady-scrape/pdf-text-markdown): that Actor handles digital PDFs and flags scanned ones as `image_only`; send those here.

Made by **SteadyScrape (steady-scrape)**.

### What you get

One dataset row per PDF:

| Field | Meaning |
|---|---|
| `status` | `ok`, `partial`, `low_confidence`, `blank`, `failed`, `skipped`, `encrypted`, `invalid`, `empty`, `too_large`, `fetch_error` |
| `text` / `markdown` | Text of the readable pages, in reading order. Markdown separates pages with `---`. |
| `pageCount`, `pagesProcessed`, `pagesCharged` | Page counts |
| `pagesOcr`, `pagesTextLayer` | How each page was read |
| `meanConfidence` | Mean OCR word confidence (0–100). A screening signal, not an accuracy guarantee. |
| `pages` | Per page: `page`, `method` (`ocr` / `text_layer`), `status`, `confidence`, `words`, `chars`, `charged`, `note` (and `text` if `includePageText` is on) |

A run summary is saved as `OUTPUT` in the key-value store.

### What you can do with it

1. **OCR a batch of scans.** Point the Actor at direct PDF links (or upload files) and get one row of text or Markdown per file.
2. **Mixed digital + scanned PDFs.** In `auto` mode, pages with a real text layer are read directly at the lower rate; only image-only pages go through OCR.
3. **Triage unreadable pages.** Low-confidence and blank pages are labeled and free. Their text is still included by default so you can review them.
4. **Document pipelines and search.** Feed the Markdown or plain text into a search index, archive or RAG pipeline, keeping `source` for citations.
5. **Hand-off from the digital extractor.** Use [PDF to Text / Markdown](https://apify.com/steady-scrape/pdf-text-markdown) first, then send `image_only` files here.

### Pricing

- **`ocr-page` $0.008** — one OCR page with mean confidence at or above `minConfidence` (default 60) and enough recognized text. Volume discounts on the Store: Bronze $0.0072, Silver $0.0064, Gold and above $0.0056.
- **`text-page` $0.001** — one page read from an existing text layer (auto mode).
- **`actor-start` $0.002** — once per run, only when at least one page is charged.

**Free:** blank pages, low-confidence pages, pages that fail or time out, and files that cannot be downloaded, opened or decrypted. Control spend with `maxPages`, `maxPagesPerFile`, `maxFiles` and the run's maximum charge. The Actor stops before starting a page it cannot charge.

**Worked examples:** 10 scanned pages in one run = 10 × $0.008 + $0.002 = **$0.082**. 3 text-layer pages + 7 OCR pages in one run = 3 × $0.001 + 7 × $0.008 + $0.002 = **$0.061**.

The default maximum charge per run is $1.00, about 10–20 typical runs. Raise it in the run options if you need a larger job.

### Input

```json
{
  "pdfUrls": ["https://www.archives.gov/files/research/jfk/releases/docid-32112987.pdf"],
  "languages": ["eng"],
  "mode": "auto",
  "format": "both",
  "maxPages": 3
}
```

- `languages`: up to 3 of English, Spanish, French, German, Portuguese, Italian.
- `mode`: `auto` (text layer when present, OCR otherwise) or `ocr_all` (ignore text layers, e.g. when a PDF's text layer is garbled).
- `dpi`: 150–400 (default 300). Very large pages are scaled down automatically.

Under **LIMITED_PERMISSIONS** the Actor downloads the URLs itself — it does not crawl websites for PDFs.

### Accuracy

In our tests on 17 synthetic printed pages in English, Spanish and French, 15 came out with under 1% character errors, including blurred, low-resolution, noisy, skewed and two-column pages. A noisy, blurred, JPEG-compressed page had about 6% character errors. Heavily degraded pages, such as a noisy, skewed invoice photocopy, can come out with many errors; in our tests that page scored below the confidence threshold and was free. Handwriting, tables and layout reconstruction are not supported: tables come out as lines of text.

### How it compares

Some image-OCR tools on the Store are cheaper per page for simple pictures. This Actor is built for **PDFs**: mixed digital and scanned files in one run, unreadable and blank pages free, a per-page confidence score, and documents that stay inside the container instead of being sent to a third-party OCR API. For already-digital PDFs, [PDF to Text / Markdown](https://apify.com/steady-scrape/pdf-text-markdown) is faster and cheaper.

### FAQ

**Does it send my PDFs to a third-party OCR API?** No. OCR runs inside the Actor container.

**Can it read handwriting or reconstruct tables?** No. It is for printed text. Tables come out as lines of text.

**What about digital PDFs?** In `auto` mode, pages with a real text layer are read directly at $0.001 per page. For a batch that is all digital, use [PDF to Text / Markdown](https://apify.com/steady-scrape/pdf-text-markdown) instead.

**What happens to low-confidence pages?** They are free. By default their text is still included so you can review it. You can raise or lower `minConfidence` (30–90).

**Password-protected files?** They return `encrypted` and are free.

**Can it find PDFs on a website for me?** No. Give direct PDF links, or upload files in the Console.

### Integrations

- **Apify API and SDKs:** call it from Python, JavaScript or any HTTP client and read results from the run's dataset.
- **Schedules and webhooks:** run it on a schedule in Apify and trigger your own endpoint when a run finishes.
- **Make, Zapier, n8n:** use Apify's own integrations for these tools to start runs and pass dataset rows on.
- **AI agents (MCP):** agents can call it through the Apify MCP server. Runs support a maximum charge so an agent can cap spend.

### Limits

- Max 20 files, 200 pages per run, 100 pages per PDF, 50 MB per file, 2 minutes per page.
- Printed text only. No handwriting. No table structure.
- Password-protected PDFs are skipped (free).

### More from SteadyScrape

- [PDF to Text / Markdown](https://apify.com/steady-scrape/pdf-text-markdown): extract text and Markdown from digital PDFs; scanned and failed files are free.
- [Bulk Image and File Downloader (ZIP + SHA-256)](https://apify.com/steady-scrape/bulk-file-downloader): download public image, PDF and file URLs into one ZIP with SHA-256 checksums; failed downloads are free.
- [AI Page to JSON: URL + Schema Extractor](https://apify.com/steady-scrape/ai-page-to-json): turn public web pages into validated JSON from your own field list or JSON Schema; failed, blocked and JS-only pages are free.
- [Public Tenders Monitor: SAM.gov, CanadaBuys & TED](https://apify.com/steady-scrape/public-tenders-monitor): government tenders from SAM.gov, CanadaBuys and TED in one feed; scheduled runs return only new and amended notices.

See every **SteadyScrape (steady-scrape)** Actor on [our Apify profile](https://apify.com/steady-scrape).

# Actor input Schema

## `pdfUrls` (type: `array`):

Direct HTTPS links to PDF files (scanned or mixed).

## `pdfFiles` (type: `array`):

Upload PDFs in the Apify Console. Prefer this for private files.

## `languages` (type: `array`):

Up to 3 languages printed in the documents. Fewer languages is faster and more accurate.

## `mode` (type: `string`):

Auto is cheaper for mixed PDFs. Use 'OCR every page' when a PDF's text layer is garbled.

## `format` (type: `string`):

Plain text, Markdown (pages separated by ---), or both.

## `dpi` (type: `integer`):

300 is the recommended default. Oversized pages are scaled down automatically to stay within limits.

## `minConfidence` (type: `integer`):

Mean word confidence (0-100) below which a page is marked low_confidence and not charged.

## `includeLowConfidenceText` (type: `boolean`):

Low-confidence pages are always free; this only controls whether their text is included in the output.

## `includePageText` (type: `boolean`):

Also return each page's text inside the pages list.

## `maxPages` (type: `integer`):

Stops after this many pages across all files.

## `maxPagesPerFile` (type: `integer`):

Only the first N pages of each PDF are processed.

## `maxFiles` (type: `integer`):

Maximum PDF files processed this run.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://www.archives.gov/files/research/jfk/releases/docid-32112987.pdf"
  ],
  "languages": [
    "eng"
  ],
  "mode": "auto",
  "format": "both",
  "dpi": 300,
  "minConfidence": 60,
  "includeLowConfidenceText": true,
  "includePageText": false,
  "maxPages": 3,
  "maxPagesPerFile": 50,
  "maxFiles": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pdfUrls": [
        "https://www.archives.gov/files/research/jfk/releases/docid-32112987.pdf"
    ],
    "maxPages": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("steady-scrape/pdf-ocr-scanned").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "pdfUrls": ["https://www.archives.gov/files/research/jfk/releases/docid-32112987.pdf"],
    "maxPages": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("steady-scrape/pdf-ocr-scanned").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pdfUrls": [
    "https://www.archives.gov/files/research/jfk/releases/docid-32112987.pdf"
  ],
  "maxPages": 3
}' |
apify call steady-scrape/pdf-ocr-scanned --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steady-scrape/pdf-ocr-scanned"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/sC4ctattsuA40N37I/builds/BZcUJcnrSG4azycHz/openapi.json
