# PDF & Image OCR Text Extractor: Scanned PDFs, JPG, PNG to Text (`datadesk-io/pdf-image-ocr-text-extractor`) Actor

Extract text from PDFs and images in bulk. Digital PDFs are read from the text layer (exact and fast); scanned PDFs and images (JPG, PNG, TIFF, WebP) use Tesseract OCR in English, Spanish, Portuguese, French, German, Italian or Dutch. One row per page with confidence. $2 per 1,000 pages.

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

## Pricing

from $1.60 / 1,000 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

## PDF & Image OCR Text Extractor: Scanned PDFs, JPG, PNG, TIFF to Text

Extract text from **PDFs and images in bulk**. **Digital PDFs** are read straight from the text layer (exact, fast); **scanned PDFs and images** (JPG, PNG, TIFF, WebP, BMP, GIF) go through **Tesseract OCR** in **English, Spanish, Portuguese, French, German, Italian or Dutch**. You get **one row per page** with the text, method used, OCR confidence, word and line counts. No external OCR API, no API key. **$2 per 1,000 pages.**

### Try it now (one click)

1. Click **Start**. The prefilled input reads a scanned test image (OCR) and the 6-page IRS W-9 PDF (text layer). In our latest check (Nov 18, 2026) it returned **7 pages in about 5 seconds**. An empty input runs a small demo too.
2. Paste direct links to your PDFs or images, choose OCR mode and languages.
3. Download the results as CSV, Excel or JSON, or get them via API, webhooks, Make or Zapier.

**Price example:** 100 pages = **$0.205**, 1,000 pages = **$2.005** ($2.00 per 1,000 pages + $0.005 per run). Silver and Gold plan users pay 10% and 20% less per page. Apify's free plan includes $5 of usage every month, enough for about 2,497 pages. Runs that find nothing are not charged.

#### Sample of real results

*Real rows from a local test run on Nov 18, 2026 (some columns). Each page also includes the other fields listed below.*

| File | Page | Method | OCR confidence | Words | Text |
|---|---|---|---|---|---|
| phototest.tif | 1 | ocr | 95.8 | 60 | This is a lot of 12 point text to test the ocr… |
| fw9.pdf | 1 | text-layer | — | 950 | Form  W-9 (Rev. March 2024) Request for Taxpay… |
| fw9.pdf | 1 | ocr | 94 | 943 | Form W-9 Request for Taxpayer Give form to the… |
| eurotext.tif | 1 | ocr | 91.3 | 73 | The (quick) \[brown] {fox} jumps! Over the $43,… |

### What you get

| Field group | Fields |
|---|---|
| Text | page text with line breaks, characters, words, lines |
| Method | text-layer or ocr, OCR confidence 0-100, OCR language |
| File | URL, file name, type, size, page number, total pages, page size |
| PDF metadata | title, author |

### Why this Actor

- **Smart auto mode:** exact text layer for digital PDFs and OCR only where a page is scanned, so most PDFs cost almost nothing to process.
- **7 OCR languages**, combinable (e.g. English + Spanish).
- **Confidence score per page** to flag bad scans.
- **Cheaper than per-image OCR APIs:** $2 per 1,000 pages, no OCR subscription.
- Works with multi-page TIFFs and scanned PDFs up to 60 MB.

### How to use it

1. Click **Try for free** (or **Start**): the prefilled input runs a quick test.
2. Paste direct links to your PDFs or images, choose OCR mode and languages.
3. Click **Start** and wait a few seconds.
4. Open the **Output** tab and export as **JSON, CSV, Excel, XML or HTML**, or read the dataset via API.

### Input examples

**Scanned image + digital PDF (prefill):**

```json
{"urls": ["https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif", "https://www.irs.gov/pub/irs-pdf/fw9.pdf"]}
```

**Spanish and English scans, always OCR, 300 DPI:**

```json
{"urls": ["https://example.com/factura-escaneada.pdf"], "ocrMode": "ocr", "ocrLanguages": ["spa", "eng"], "ocrDpi": 300}
```

**Receipts (single text block):**

```json
{"urls": ["https://example.com/receipt1.jpg", "https://example.com/receipt2.png"], "layout": "block"}
```

#### Input fields

| Field | Type | Description |
|---|---|---|
| `urls` | array | Direct links to PDF files or images (PNG, JPG, TIFF, WebP, BMP, GIF), one per line. Files must be publicly downloadable (max 60 MB each). Leave empty for a demo (1 scanned image + 1 PDF). |
| `ocrMode` | string | Auto is fastest and exact for digital PDFs and runs OCR only on pages without text (scans). Images always use OCR. |
| `ocrLanguages` | array | Languages in the documents (pick one or more). Choosing the right language keeps accents and special letters. |
| `maxPagesPerFile` | integer | Only the first N pages of each PDF/TIFF are read (cost control). |
| `maxPages` | integer | Hard cap for the whole run. |
| `skipEmptyPages` | boolean | Do not save (or charge) pages where no text was found. |
| `ocrDpi` | integer | Rendering resolution for scanned PDF pages. 200 is a good balance; use 300 for small print. |
| `layout` | string | How OCR segments the page. Use "Single text block" for receipts or simple labels. |

### Output example

*Example record from a local test run (long lists shortened).*

```json
{
  "url": "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
  "fileName": "phototest.tif",
  "fileType": "tiff",
  "fileSizeBytes": 38668,
  "language": "eng",
  "page": 1,
  "pageCount": 1,
  "text": "This is a lot of 12 point text to test the\nocr code and see if it works on all types\nof file format.\n\nThe quick brown dog jumped over the\nlazy fox. The quick brown dog jumped\nover the lazy fox. The qu…",
  "method": "ocr",
  "ocrConfidence": 95.8,
  "width": 640,
  "height": 480,
  "documentTitle": null,
  "documentAuthor": null,
  "charCount": 285,
  "wordCount": 60,
  "lineCount": 8,
  "scrapedAt": "2026-11-18T23:28:26.229388+00:00",
  "isNew": false
}
```

#### Output fields

| Field | Description |
|---|---|
| `url` | Source file link |
| `fileName` | File name from the URL |
| `fileType` | pdf, png, jpg, tiff, webp, bmp or gif |
| `page` | Page number (1-based) |
| `pageCount` | Total pages in the file |
| `text` | Extracted text of the page (line breaks kept) |
| `method` | text-layer (exact, from the PDF) or ocr (Tesseract) |
| `ocrConfidence` | Average word confidence 0-100 (OCR pages only) |
| `charCount` | Characters of text on the page |
| `wordCount` | Words on the page |
| `lineCount` | Non-empty lines on the page |
| `width` | Page width (PDF points) or image width (px) |
| `height` | Page height (PDF points) or image height (px) |
| `documentTitle` | PDF title metadata |
| `documentAuthor` | PDF author metadata |
| `fileSizeBytes` | File size in bytes |
| `language` | Tesseract language(s) used |
| `scrapedAt` | When the row was saved (UTC) |
| `isNew` | Always false (no alerts mode) |

### Pricing

Pay-per-event: **$0.005** once per run that saves results + **$0.002 per page** ($2.00 / 1,000). Runs that save nothing are not charged.

| Pages saved | Approx. cost |
|---|---|
| 20 | $0.045 |
| 100 | $0.205 |
| 1,000 | $2.005 |
| 10,000 | $20.005 |

### Use cases

- Turn scanned invoices, contracts and forms into searchable text
- Feed PDFs to LLMs / RAG pipelines (one chunk per page)
- Bulk OCR for archives and document management
- Extract text from screenshots, receipts and labels
- Check which PDFs are scanned (method = ocr) vs digital

### Integrations / API

Works with the Apify API, Schedules, webhooks, Make, Zapier, n8n and MCP. Example:

```bash
curl "https://api.apify.com/v2/acts/datadesk-io~pdf-image-ocr-text-extractor/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"urls": ["https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif", "https://www.irs.gov/pub/irs-pdf/fw9.pdf"]}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("datadesk-io/pdf-image-ocr-text-extractor").call(run_input={"urls": ["https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif", "https://www.irs.gov/pub/irs-pdf/fw9.pdf"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### MCP

Use this Actor from an MCP client (Cursor, Claude Desktop, etc.) through the Apify MCP server (`datadesk-io/pdf-image-ocr-text-extractor`).

### FAQ

**Which files work?** Public direct links to PDF, PNG, JPG, TIFF (multi-page), WebP, BMP and GIF, up to 60 MB each. For private files, upload them to an Apify key-value store or any storage with a direct link.

**How accurate is OCR?** Clean scans usually get 90-96 confidence. Low-resolution photos and handwriting read worse; try 300 DPI and the right language.

**Do you send my files to a third-party API?** No. OCR runs inside the Actor with open-source Tesseract.

**Are empty pages charged?** No (with "Skip empty pages", the default).

**What does an empty input do?** It reads a demo scanned image and a demo PDF.

### Limitations

- No handwriting recognition.
- Tables are returned as text lines, not as cells.
- Password-protected PDFs cannot be read.
- OCR languages: English, Spanish, Portuguese, French, German, Italian, Dutch.

### Start now

Click **Start** to run the prefilled example, then adjust the input. Missing a field or filter? Open an issue on the **Issues** tab and tell us what you need.

### Support

Questions, bugs or a missing field? Email **datadesk.io@proton.me** or open an issue on the Actor page.

***

**ES:** Extrae texto de PDFs e imágenes en lote: capa de texto para PDFs digitales y OCR (Tesseract) para escaneos en 7 idiomas, una fila por página. $2 por 1.000 páginas.
**PT:** Extraia texto de PDFs e imagens em lote: camada de texto para PDFs digitais e OCR (Tesseract) para digitalizações em 7 idiomas, uma linha por página. US$2 por 1.000 páginas.

# Actor input Schema

## `urls` (type: `array`):

Direct links to PDF files or images (PNG, JPG, TIFF, WebP, BMP, GIF), one per line. Files must be publicly downloadable (max 60 MB each). Leave empty for a demo (1 scanned image + 1 PDF).

## `ocrMode` (type: `string`):

Auto is fastest and exact for digital PDFs and runs OCR only on pages without text (scans). Images always use OCR.

## `ocrLanguages` (type: `array`):

Languages in the documents (pick one or more). Choosing the right language keeps accents and special letters.

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

Only the first N pages of each PDF/TIFF are read (cost control).

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

Hard cap for the whole run.

## `skipEmptyPages` (type: `boolean`):

Do not save (or charge) pages where no text was found.

## `ocrDpi` (type: `integer`):

Rendering resolution for scanned PDF pages. 200 is a good balance; use 300 for small print.

## `layout` (type: `string`):

How OCR segments the page. Use "Single text block" for receipts or simple labels.

## Actor input object example

```json
{
  "urls": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    "https://example.com/scan.jpg"
  ],
  "ocrMode": "auto",
  "ocrLanguages": [
    "eng",
    "spa"
  ],
  "maxPagesPerFile": 50,
  "maxPages": 2000,
  "skipEmptyPages": true,
  "ocrDpi": 300,
  "layout": "auto"
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
        "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datadesk-io/pdf-image-ocr-text-extractor").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 = { "urls": [
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
        "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("datadesk-io/pdf-image-ocr-text-extractor").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 '{
  "urls": [
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ]
}' |
apify call datadesk-io/pdf-image-ocr-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datadesk-io/pdf-image-ocr-text-extractor"
        }
    }
}
```

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/h0VlXwHuQnZSmoFcT/builds/XB5r44gQnxsf50oBX/openapi.json
