# Image to Text OCR and Scanned PDF Text Extractor (`cleanscrape/image-pdf-ocr-text-extractor`) Actor

Image to text OCR and PDF text extractor: read scanned PDFs, photos, screenshots and receipts in about 80 languages with PP-OCRv6, from links or another Actor's dataset. PDF pages with their own text are read exactly. No API key or login. $3 per 1,000 OCR pages. Maintained by CleanScrape.

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

## Pricing

from $2.40 / 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

## Image to Text OCR and Scanned PDF Text Extractor

Image to text OCR and PDF text extraction in one Actor: paste links to photos, screenshots, receipts, scanned PDFs or ordinary PDFs, or point it at another Actor's results, and get the text of every file and every page. Scanned pages and images are read with PaddleOCR's open-source PP-OCRv6 models (PP-OCRv5 for Cyrillic, Korean, Arabic and the other writing systems), in about 80 languages; PDF pages that carry their own text are read from that text, which is exact and costs a tenth as much. Columns, paragraphs and table rows keep their reading order. No API key, no login, and the files never leave Apify.

**$3 per 1,000 OCR pages and $0.30 per 1,000 PDF text pages. Pages without text and files that can't be read are free. No start fee.** The form's first run (a photographed letter and a two-page PDF) costs under $0.01.

### Watch the walkthrough

The 1969 "In Event of Moon Disaster" memo becomes text again in five seconds, the whole 254-page Apollo 11 press kit is read in about five minutes (49,678 words), and a photo of the plaque taken on the Moon is read through a ladder and the camera’s crosshairs. This 93-second demo uses real runs.

https://youtu.be/HZQqOaIh85U

### Start with a small run

1. Under **Image and PDF links**, keep the two samples or paste your own links, one per line. Dropbox, Google Drive and GitHub file links work when the file is shared publicly.
2. If the text is not in Latin letters, Chinese or Japanese, choose its **Writing system** (Cyrillic, Korean, Arabic, Greek, Thai, Hindi and more).
3. Click **Start**. The **Text per file** table has the whole text of each file; **Text per page** has each page with how it was read and how sure the OCR was.

### Example

It opens with its input filled in. Change the input and run it.

| Example | What it does |
| --- | --- |
| [Read a scanned 1969 memo and a Moon photo as text](https://apify.com/cleanscrape/image-pdf-ocr-text-extractor/examples/scanned-pdf-and-photo-to-text) | OCR of a typed 1969 memo from the National Archives (a scanned PDF) and NASA's photo of the Apollo 11 plaque, with each line's position. |

### What it reads

| You give it | What happens |
| --- | --- |
| A photo or screenshot (JPEG, PNG, WebP, HEIC, BMP, GIF) | OCR. Phone photos are turned upright (also pages lying on their side or upside down) and large photos are scaled to 4,000 pixels. |
| A scanned PDF | OCR on every page, at about 150 dpi. |
| A PDF made on a computer | The PDF's own text, exact, no OCR. A page that is one big picture inside such a PDF still gets OCR. |
| A multi-page TIFF (fax, scanner) | OCR on every page. |
| A password-protected PDF | Read with the password you enter under **PDF password**. |
| A web page, Word file, video or audio | Not read, listed under **Not read** with the reason, free. |

The text comes out the way people read it: two-column pages column by column, paragraphs separated by a blank line, and the cells of one table row on one line separated by tabs (a receipt line stays `Baguette<TAB>1.20`, not two lines far apart).

### Read the files another Actor found

Choose a dataset under **Links from a dataset**, for example the run of [Bulk File Downloader](https://apify.com/cleanscrape/bulk-file-downloader) that saved invoices from your links, or a scraper that returns image or PDF links. The field with the links is found automatically (`downloadUrl`, `imageUrl`, `pdf`, `image`, `attachment`...), or name it under **Link field in the dataset**.

As an integration (the other Actor's **Integrations** tab, "Connect Actor or Task"), this Actor runs after each of its runs. Give it `{"datasetId": "{{resource.defaultDatasetId}}"}` as input.

### Use it from the API

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("cleanscrape/image-pdf-ocr-text-extractor").call(run_input={
    "files": [
        "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/scanned-letter.jpg",
        "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/mixed-document.pdf",
    ],
})
for f in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f["fileName"], f["pagesRead"], "pages,", f["words"], "words")
    print(f["text"][:300])
```

Pages, with how each was read, are in the run's `pages` dataset: `client.dataset(run["storageIds"]["datasets"]["pages"]).iterate_items()`. Files that could not be read are in `failed`.

### Input

| Field | What it does |
| --- | --- |
| Image and PDF links | One link per line, or a block of text with links in it. A repeated link is read once. |
| Links from a dataset | Another run's dataset; its image and PDF links are added to the ones above. |
| Link field in the dataset | Optional: the field with the links, such as `downloadUrl` or `images.url`. |
| Writing system | Latin letters with Chinese and Japanese (default), Traditional Chinese, Cyrillic, Korean, Arabic script, Greek, Thai, Devanagari, Tamil or Telugu. |
| PDF pages | Use the PDF's own text when it has it (default), OCR every page, or never OCR. |
| OCR quality | Standard (default), Fast, or Most accurate. Same price. |
| Pages | Optional: which PDF pages, such as `1-5, 8, 12-`. |
| Pages per file | The most pages read from one file (default 200, up to 5,000). |
| Largest file (MB) | Default 200. |
| Include line positions | Adds each OCR line with its confidence and box (x, y, width, height) to the pages table. |
| PDF password | For protected PDFs. |

### Output

**Text per file** (default dataset, one row per file read):

| Field | Example |
| --- | --- |
| `fileName`, `fileUrl`, `fileType` | `scanned-letter.jpg`, its link, `jpg` |
| `text` | the whole text, pages in order |
| `pagesRead`, `ocrPages`, `textLayerPages`, `emptyPages` | `2`, `1`, `1`, `0` |
| `characters`, `words` | `1268`, `214` |
| `averageConfidence` | `0.992` (0 to 1, OCR pages only) |
| `textFileUrl` | the text as a `.txt` file, works without a token |
| `complete`, `note` | `false` and why, when pages were left out or the run stopped |

**Text per page** (dataset `pages`): `page`, `readBy` (`OCR` or `PDF text`), `text`, `confidence`, `lineCount`, `rotatedDegrees` and what the page was charged as; with **Include line positions**, every line with its box.

**Not read** (dataset `failed`, free): the link and the reason in words, such as "The link opens a web page, not an image or PDF" or "The PDF is protected by a password".

The run's key-value store has the `.txt` files, `REPORT` (a readable run report) and `SUMMARY` (the same as JSON).

### Accuracy

Measured on test pages with known text, Standard quality:

| Page | Result |
| --- | --- |
| Printed pages in English, German, French, Spanish, Finnish, Russian, Chinese, Japanese | no character errors on clean pages and office scans |
| The same pages photographed with a phone (turned, blurred, uneven light, JPEG) | 95 to 98% of characters right on most of them |
| Pages of a research paper, rendered and read with OCR | 97 to 100% of their words |
| The US tax form 1040 (small print in boxes) | 95% of its words |

It reads printed text: handwriting reads poorly or not at all, very small text in a big photo may be missed, and a tiny image (a few hundred pixels wide) can repeat or drop a letter. The `confidence` of each page shows where to look twice; under 0.8 is worth checking. Choosing the wrong writing system gives almost no text (Cyrillic read as Latin comes out as numbers and punctuation): the file's note then says so.

### Pricing

| Event | Price |
| --- | --- |
| OCR page (an image, or a PDF page without its own text) | $0.003 |
| PDF text page (read from the PDF's own text) | $0.0003 |

| Run | Cost |
| --- | ---: |
| The form's first run: 1 photo + a 2-page PDF (1 scanned page) | $0.0063 |
| 200 receipt photos | $0.60 |
| A 77-page research paper (its own text) | $0.023 |
| A 300-page scanned book | $0.90 |
| 50 links that fail, blank pages | $0 |

Bronze, Silver and Gold Apify plans get 10%, 15% and 20% off every event. Set **Maximum cost per run** to cap a run: it stops at the limit and keeps everything read until then.

### Speed

Measured on Apify with the default 4 GB of memory: a photographed letter in about 2 seconds, a 15-page scanned paper in about a minute, a 77-page PDF with its own text in 4 seconds. 8 GB reads OCR pages about twice as fast at the same cost per page. Long jobs stop cleanly before the run's time limit and keep every page read; raise the timeout under Run options for more.

### Use it from an AI agent

This Actor works as a tool in Claude, ChatGPT, Cursor and other AI assistants that support MCP, through Apify's MCP server. Add this server and sign in with your Apify account when asked:

```
https://mcp.apify.com?tools=cleanscrape/image-pdf-ocr-text-extractor
```

Then ask in plain words, for example: "Read the text of these scanned invoices and give me each invoice number, date and total." The assistant runs the Actor in your Apify account and reads the results. The price per result is the same as in Console.

For coding agents (Claude Code, Codex, Cursor and others), a free skill explains the inputs, costs and how to read the results: `npx skills add CleanScrape/agent-skills --skill apify-cleanscrape-ocr-text-extraction`. From a terminal, the [Apify CLI](https://docs.apify.com/cli) runs it too:

```bash
apify call cleanscrape/image-pdf-ocr-text-extractor -i '{"files":["https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/scanned-letter.jpg","https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/mixed-document.pdf"]}' --output-dataset
```

### Common questions

#### Is this the same OCR as Google Lens or Tesseract?

No. It uses PaddleOCR's open-source PP-OCRv6 models (PP-OCRv5 for some writing systems) running inside the Actor, so nothing is sent to Google or any other service.

#### Can it read handwriting?

Neat block letters sometimes, joined-up handwriting no. It is built for printed and screen text.

#### Can it extract tables?

Table rows come out as lines with tab-separated cells, which paste straight into a spreadsheet. It does not rebuild merged cells or borders.

#### Does it make searchable PDFs?

Not yet: it returns the text, per file and per page, and a `.txt` file per document.

#### How do I export the text to Excel, CSV or Google Sheets?

Use the Export button on the Output tab (CSV, Excel, JSON), or the `textFileUrl` of each file. The pages table exports from Storage > Datasets.

#### What languages does it read?

About 50 languages in Latin letters (English, Spanish, Portuguese, French, German, Italian, Dutch, the Nordic languages, Polish, Czech, Turkish, Vietnamese, Indonesian...), Chinese (simplified and traditional), Japanese, Korean, Russian and other Cyrillic languages, Arabic, Persian and Urdu, Greek, Thai, Hindi, Marathi, Nepali, Tamil and Telugu. One writing system per run; English words and numbers are read in all of them.

#### Are my files private?

The files are downloaded into the run, read there and deleted when it ends; only the text is saved, in your own run storage. No outside OCR service sees them.

#### Is it legal?

It reads files you link to. Make sure you have the right to process them, especially documents with personal data.

### Support

Questions or a result that looks wrong: open an issue on the Issues tab or email contact.cleanscrape@gmail.com. Include the run ID.

If the Actor was useful, an honest review on its Store page helps other people find it.

Maintained by CleanScrape. Not affiliated with PaddlePaddle or Baidu.

### More tools from CleanScrape

- [Audio & Video Transcription (Whisper) for Text and Subtitles](https://apify.com/cleanscrape/audio-video-transcription-whisper): audio and video files to text with timestamps and SRT and VTT subtitles, with Whisper
- [Audio Transcription and Speech to Text for Podcasts](https://apify.com/cleanscrape/podcast-transcription): podcast feeds, Apple Podcasts links and audio files to text with timestamps and subtitles
- [Video Frame Extractor for Scene Changes and Thumbnails](https://apify.com/cleanscrape/video-frame-extractor): still images from video files at scene changes, intervals or timestamps, with contact sheets
- [Bulk File Downloader for Images, PDFs, Video and Audio](https://apify.com/cleanscrape/bulk-file-downloader): images, PDFs, videos and audio from a list of links or from any scraper's results, with download links, sizes, SHA-256 and optional ZIP archives

All CleanScrape tools: [apify.com/cleanscrape](https://apify.com/cleanscrape)

# Actor input Schema

## `files` (type: `array`):

One link per line to an image (JPEG, PNG, WebP, HEIC, TIFF, BMP, GIF) or a PDF. Dropbox, Google Drive and GitHub file links work when the file is shared publicly. You can also paste a block of text: every link in it is used, and a repeated link is read once.

## `datasetId` (type: `string`):

A dataset whose rows hold image or PDF links. Its links are added to the ones above (remove the sample links there).

## `datasetField` (type: `string`):

The field that holds the file link, such as downloadUrl, imageUrl or images.url. Leave empty to pick it automatically: a field named like download, image, photo, scan, file or pdf, or one whose links end in .jpg, .png or .pdf.

## `script` (type: `string`):

The script of the text in your files. The first choice reads about 50 languages written in Latin letters together with Chinese and Japanese, and English words and numbers are read in every choice. Choose one writing system per run.

## `readMode` (type: `string`):

A PDF made on a computer carries its text: reading it is exact and costs much less. Scanned pages, and pages that are one big picture, are read with OCR. Images always use OCR.

## `quality` (type: `string`):

The model size used for OCR. Standard read 99 to 100% of the words on test pages, and 95 to 98% of the letters on blurry phone photos. The price per page is the same for every choice; slower choices just take longer.

## `pages` (type: `string`):

Which PDF pages to read, such as 1-5, 8, 12- (12- means page 12 to the end). Empty: every page. Applies to every PDF in the run.

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

The most pages read from one PDF or multi-page TIFF. Pages past it are left out and named in the file's note.

## `maxFileMb` (type: `integer`):

A larger file is stopped while it downloads and listed in the "Not read" table, free.

## `includeLines` (type: `boolean`):

Adds every OCR line with its confidence and position (x, y, width, height in pixels) to the pages table. Useful for forms, highlighting and checking low-confidence lines.

## `pdfPassword` (type: `string`):

For password-protected PDFs. The same password is tried on every PDF in the run.

## Actor input object example

```json
{
  "files": [
    "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/scanned-letter.jpg",
    "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/sample-report.pdf"
  ],
  "script": "latin",
  "readMode": "auto",
  "quality": "standard",
  "maxPagesPerFile": 200,
  "maxFileMb": 200,
  "includeLines": false
}
```

# Actor output Schema

## `files` (type: `string`):

No description

## `pages` (type: `string`):

No description

## `failed` (type: `string`):

No description

## `texts` (type: `string`):

No description

## `report` (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 = {
    "files": [
        "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/scanned-letter.jpg",
        "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/sample-report.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cleanscrape/image-pdf-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 = { "files": [
        "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/scanned-letter.jpg",
        "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/sample-report.pdf",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("cleanscrape/image-pdf-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 '{
  "files": [
    "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/scanned-letter.jpg",
    "https://api.apify.com/v2/key-value-stores/RoMzWkwkqTc8cuf9c/records/sample-report.pdf"
  ]
}' |
apify call cleanscrape/image-pdf-ocr-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cleanscrape/image-pdf-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/rNPucap1TrJweJIIz/builds/NkXwEN3kfHZ4ibsrO/openapi.json
