# Extract text from scanned PDFs with OCR

**Use case:** 

Turn scanned PDFs (pages that are only images) into searchable text, page by page. The task detects which pages need OCR, cleans them up, and returns the text with page numbers and character counts. Digital pages are read directly at a lower price. Works with invoices, contracts, letters and archives.

## Input

```json
{
  "urls": [
    "https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/skew.pdf",
    "https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/linn.pdf"
  ],
  "languages": [
    "eng"
  ],
  "ocrMode": "auto",
  "outputMode": "page",
  "includeLines": false,
  "maxPagesPerFile": 200,
  "ocrDpi": 300,
  "minTextCharsPerPage": 25
}
```

## Output

```json
{
  "url": {
    "label": "File",
    "format": "link"
  },
  "fileType": {
    "label": "Type",
    "format": "text"
  },
  "pageCount": {
    "label": "Pages",
    "format": "number"
  },
  "pagesProcessed": {
    "label": "Processed",
    "format": "number"
  },
  "ocrPages": {
    "label": "OCR pages",
    "format": "number"
  },
  "textLayerPages": {
    "label": "Text-layer pages",
    "format": "number"
  },
  "avgOcrConfidence": {
    "label": "OCR confidence",
    "format": "number"
  },
  "wordCount": {
    "label": "Words",
    "format": "number"
  },
  "text": {
    "label": "Text",
    "format": "text"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The PDF & Image to Text - OCR, Scanned PDFs, Bulk Text Extraction Actor is ready to run with the inputs already set for "Extract text from scanned PDFs with OCR". [Sign up or log in](https://console.apify.com/create-task-from-example/PKQffjUJVezfnJhTM) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Extract text from scanned PDFs with OCR" task

The PDF & Image to Text - OCR, Scanned PDFs, Bulk Text Extraction Actor will start running based on the input automatically. You can also change all the input fields, like file urls, document languages, and more, to match your specific use case.

### 3. Receive the "Extract text from scanned PDFs with OCR" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as file, type, pages, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Extract text from scanned PDFs with OCR" task via API](https://apify.com/cuestadata/pdf-image-text-extractor.md).

## FAQ

### What does the scanned PDF to text task return?

The scanned PDF to text task returns the text of each page with its page number, whether OCR was used, and character counts, ready to export as JSON, CSV or Excel.

### How much does OCR on scanned PDFs cost?

OCR on scanned PDF pages costs about $3 per 1,000 pages. Pages that already have a text layer cost about $0.20 per 1,000 pages.

### Which languages can the scanned PDF OCR read?

The scanned PDF OCR task reads English, Spanish, French, German, Portuguese, Italian and Dutch, alone or combined.

## About this Actor

This example demonstrates how to use [PDF & Image to Text - OCR, Scanned PDFs, Bulk Text Extraction](https://apify.com/cuestadata/pdf-image-text-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/cuestadata/pdf-image-text-extractor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/cuestadata/pdf-image-text-extractor.md

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`).
