# PDF & Image OCR: Text, Tables & Markdown Extractor (`edgar2026/pdf-image-ocr`) Actor

Extract text and tables from PDFs and images with OCR (Amazon Textract). Digital PDFs are read directly at $1 per 1,000 pages; scanned pages and images are OCRed. Returns plain text, Markdown with tables and per-page results.

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

## Pricing

from $3.10 / 1,000 page processed with ocrs

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, Tables & Markdown Extractor

Extract text and tables from **PDFs, scanned documents and images** (PNG, JPEG, TIFF) with **Amazon Textract**, one of the most accurate OCR engines available. Digital PDFs are read directly from their text layer for **$1 per 1,000 pages**; only scanned pages and images go through OCR. You get the full text, clean **Markdown with tables** for LLMs and RAG, and per-page results.

### Why this OCR

- **Pay for what needs OCR:** pages that already contain digital text are read directly at a fraction of the price. Scanned pages in the same PDF are detected and OCRed automatically.
- **Tables that stay tables:** turn on table extraction to get every table as a cell grid and as Markdown, ready for spreadsheets or AI pipelines.
- **Built for documents:** invoices, receipts, contracts, forms, reports, research papers and scanned books.
- **Up to 500 pages per file and 500 files per run.** You can cap pages per file to control cost.

### Input

- **PDF or image URLs:** direct links to PDF, PNG, JPEG or TIFF files, up to 100 MB each.
- **Extract tables:** layout analysis on every page; tables returned as grids and Markdown.
- **Force OCR on every page:** for PDFs whose embedded text is broken or garbled.
- **Max pages per file:** only the first N pages are processed and charged.
- **Include per-page output:** text and tables for each page separately.

### Output example

Real output for the IRS Form W-9 (6 pages, texts shortened):

```json
{
    "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    "pageCount": 6,
    "pagesProcessed": 6,
    "truncated": false,
    "pagesTextLayer": 6,
    "pagesOcr": 0,
    "tableCount": 0,
    "wordCount": 6279,
    "text": "Form W-9 (Rev. March 2024) Request for Taxpayer Identification Number and Certification ...",
    "markdown": "## Page 1\n\nForm W-9 (Rev. March 2024) ...",
    "pages": [{ "page": 1, "method": "text-layer", "text": "...", "tables": [] }],
    "error": null
}
```

With **Extract tables** on, each page includes tables such as `[["Item", "Qty", "Price"], ["Widget", "2", "10.00"]]`, and the Markdown contains them as Markdown tables. Files that can't be downloaded, are password-protected or aren't PDFs or images get an `error` message and are not charged.

### How much does it cost?

| Event | Price (free plan) |
|---|---|
| Run start | $0.02 |
| Page read from the PDF text layer | $0.001 |
| Page or image processed with OCR | $0.004 |
| Page processed with table extraction | $0.03 |

Paid Apify plans get lower prices automatically. Examples on the free plan:

- A 100-page digital PDF: **$0.12**
- 100 scanned pages or photos of receipts: **$0.42**
- 20 pages with table extraction: **$0.62**

Set **Maximum cost per run** to cap spending. Each file is only started if the remaining budget covers it.

### FAQ

**Which OCR engine is used?** Amazon Textract, which also reads handwriting reasonably well and handles low-quality scans better than most open-source engines.

**Are my documents stored?** Files are downloaded to temporary storage only for processing and deleted right after. Results are saved only in your Apify dataset.

**Can I use it in AI workflows?** Yes. The `markdown` field is designed for LLM and RAG pipelines. Call the Actor from the Apify API, Make, Zapier, n8n or the Apify MCP server.

**What languages are supported?** Textract OCR supports English, Spanish, Portuguese, French, German and Italian. The text layer of digital PDFs is read in any language.

### Related

From the same author: **Audio & Video Transcriber**, **Amazon Product Scraper**, **Keyword Research Tool**, **Website Organic Traffic Checker** and **AI Search Visibility Tracker**.

### Support

Open an issue in the **Issues** tab. Issues are reviewed regularly.

# Changelog

This Actor's version history is a separate document: https://apify.com/edgar2026/pdf-image-ocr/changelog.md

# Actor input Schema

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

Direct links to PDF, PNG, JPEG or TIFF files (up to 100 MB each). Up to 500 files per run.

## `extractTables` (type: `boolean`):

Detect tables and return them as cell grids and Markdown. Uses layout analysis on every page, so it costs more per page.

## `forceOcr` (type: `boolean`):

By default, pages with a digital text layer are read directly (cheaper) and only scanned pages are OCRed. Turn on if the embedded text is broken or garbled.

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

Only the first N pages of each document are processed and charged.

## `includePages` (type: `boolean`):

Adds the text and tables of every page separately. The full text and Markdown are always included.

## Actor input object example

```json
{
  "files": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "extractTables": false,
  "forceOcr": false,
  "maxPagesPerFile": 50,
  "includePages": true
}
```

# Actor output Schema

## `results` (type: `string`):

Document rows with extracted text, Markdown, tables and optional per-page results. Failed documents contain an error.

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

Processing totals and summary metadata for the run.

# 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://www.irs.gov/pub/irs-pdf/fw9.pdf"
    ],
    "maxPagesPerFile": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("edgar2026/pdf-image-ocr").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://www.irs.gov/pub/irs-pdf/fw9.pdf"],
    "maxPagesPerFile": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("edgar2026/pdf-image-ocr").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://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "maxPagesPerFile": 50
}' |
apify call edgar2026/pdf-image-ocr --silent --output-dataset

```

## MCP server setup

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

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/HOikGpO8DguogdPcw/builds/7ah4tAGhwq5SN3BnN/openapi.json
