# Scanned PDF to text with OCR

**Use case:** 

Read scanned PDFs, faxes and image-only pages with OCR in 20 languages. This example reads a typewritten 1954 memorandum (public domain). Only pages without a text layer go to OCR, so digital pages stay fast and cheap.

## Input

```json
{
  "urls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/41/CIA_Memorandum_by_Claude_E._Hawley_for_Chief_of_RQM-OIS.pdf"
  ],
  "output_format": "document",
  "include_markdown": true,
  "include_pages": false,
  "extract_tables": true,
  "chunk_size": 1000,
  "chunk_overlap": 150,
  "ocr_scanned_pages": true,
  "ocr_languages": [
    "eng"
  ],
  "ocr_max_pages_per_pdf": 2000,
  "export_images": false,
  "images_min_size_px": 64,
  "images_skip_duplicates": true,
  "images_format": "original",
  "images_max_per_pdf": 500,
  "page_images": false,
  "page_images_dpi": 150,
  "page_images_format": "png",
  "page_images_quality": 90,
  "page_images_thumbnail": false,
  "page_images_max_per_pdf": 2000,
  "remove_headers_footers": false,
  "remove_page_numbers": false,
  "remove_blank_lines": false,
  "skip_empty_pages": false,
  "max_pages_per_pdf": 2000,
  "max_pdf_size_mb": 100,
  "timeout_per_pdf_secs": 1800,
  "max_concurrency": 3
}
```

## Output

```json
{
  "source": {
    "label": "Source",
    "format": "text"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "page_count": {
    "label": "Pages",
    "format": "number"
  },
  "extracted_page_count": {
    "label": "Pages extracted",
    "format": "number"
  },
  "ocr_page_count": {
    "label": "OCR pages",
    "format": "number"
  },
  "title": {
    "label": "Title",
    "format": "text"
  },
  "author": {
    "label": "Author",
    "format": "text"
  },
  "char_count": {
    "label": "Characters",
    "format": "number"
  },
  "word_count": {
    "label": "Words",
    "format": "number"
  },
  "text": {
    "label": "Text",
    "format": "text"
  },
  "markdown": {
    "label": "Markdown",
    "format": "text"
  },
  "page": {
    "label": "Page",
    "format": "number"
  },
  "chunk_index": {
    "label": "Chunk",
    "format": "number"
  },
  "page_start": {
    "label": "From page",
    "format": "number"
  },
  "page_end": {
    "label": "To page",
    "format": "number"
  },
  "subject": {
    "label": "Subject",
    "format": "text"
  },
  "creator": {
    "label": "Creator",
    "format": "text"
  },
  "producer": {
    "label": "Producer",
    "format": "text"
  },
  "created_at": {
    "label": "Created at",
    "format": "text"
  },
  "modified_at": {
    "label": "Modified at",
    "format": "text"
  },
  "is_encrypted": {
    "label": "Protected",
    "format": "boolean"
  },
  "file_size_mb": {
    "label": "Size (MB)",
    "format": "number"
  },
  "source_type": {
    "label": "Source type",
    "format": "text"
  },
  "file_type": {
    "label": "File type",
    "format": "text"
  },
  "error_code": {
    "label": "Error code",
    "format": "text"
  },
  "error": {
    "label": "Note or error",
    "format": "text"
  },
  "processed_at": {
    "label": "Processed at",
    "format": "date"
  }
}
```

## How it works

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

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

### 2. Start the "Scanned PDF to text with OCR" task

The PDF Extractor All-in-One: Text, Tables & OCR Actor will start running based on the input automatically. You can also change all the input fields, like 📄 pdf urls, 🧾 output format, and more, to match your specific use case.

### 3. Receive the "Scanned PDF to text 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 source, status, 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 "Scanned PDF to text with OCR" task via API](https://apify.com/t800solutions/pdf-extractor.md).

## FAQ

### Which OCR languages are supported?

English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Ukrainian, Arabic, Hindi, Japanese, Korean, Chinese, Vietnamese, Indonesian and Thai. Pick several at once.

### How much does OCR cost?

$6.00 per 1,000 OCR pages on the Free plan, on top of the page price. Pages that already have text are not sent to OCR.

## About this Actor

This example demonstrates how to use [PDF Extractor All-in-One: Text, Tables & OCR](https://apify.com/t800solutions/pdf-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/t800solutions/pdf-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/t800solutions/pdf-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`).
