# PDF & Image to Text OCR – Tables as Rows (`tidelinedata/pdf-image-to-text-ocr`) Actor

Turn PDFs, scans, photos and screenshots into clean text. Tables, invoices and receipts come back as rows of cells (JSON and CSV), even from scans and phone photos. Reads text layers directly, OCRs only pages that need it, 20 languages. Pay per page with text; empty pages are free.

- **URL**: https://apify.com/tidelinedata/pdf-image-to-text-ocr.md
- **Developed by:** [Tideline Data](https://apify.com/tidelinedata) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 page with texts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 to Text OCR – Tables as Rows** turns PDFs, scans, phone photos and screenshots into clean text. Tables, invoice lines and receipt items come back as **rows of cells** (JSON and CSV), also when the document is a scan or a photo, not just a digital PDF.

![A scanned invoice and the rows this Actor returns](https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/demo-invoice-to-rows.png?signature=18XFYClakRzBJ6zGH2Yhr)

### What it does

- **Reads any PDF or image.** Digital PDFs are read straight from their text layer (exact, instant). Scanned pages, photos and screenshots go through OCR. A PDF that mixes both is handled page by page.
- **Keeps tables together.** Columns are split into cells, so each invoice line or receipt item stays on one row with its price. You get every table as JSON rows and as CSV.
- **Reads in reading order.** Two-column pages come out column by column, not mixed line by line. Tilted scans are straightened first.
- **Tells you when a page is empty.** Each page has an `empty` flag and an OCR confidence. Empty pages are not charged.
- **20+ languages.** English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Czech, Swedish, Danish, Norwegian, Finnish, Turkish, Russian, Ukrainian, Arabic, Hindi, Japanese, Chinese (simplified) and Korean.
- **Your files stay yours.** Files are read inside your own run. Results go only to your run's storage. Nothing is kept or shared by us.

### Good for

- Invoices and bills into a spreadsheet or accounting tool
- Receipts and expense photos into line items
- Scanned reports, price lists and statements into tables
- Screenshots and photos into searchable text
- Feeding documents to an AI model or a search index (RAG) as clean text

### How to use it

1. Click **Try for free**.
2. Paste links to your files in **File links** (or upload one file). Google Drive and Dropbox share links work if the file is shared with "anyone with the link".
3. Pick the **languages** in your documents. English alone is the fastest and most accurate choice for English receipts and photos. Pick only the languages you need.
4. Click **Start**. Download the results as JSON, CSV or Excel, or connect them to Google Drive, Make, Zapier or your own code through the API.

### Output

One row per page:

```json
{
  "fileName": "invoice.pdf",
  "page": 1,
  "pageCount": 1,
  "source": "ocr",
  "text": "INVOICE\nBluefin Office Goods Ltd\n...\nItem\tQty\tUnit price\tAmount\nA4 copy paper, box\t4\t21.50\t86.00\n...",
  "tables": [
    { "rows": [
      ["Item", "Qty", "Unit price", "Amount"],
      ["A4 copy paper, box", "4", "21.50", "86.00"],
      ["Toner cartridge K-220", "2", "64.90", "129.80"],
      ["Desk organiser", "3", "12.75", "38.25"]
    ] }
  ],
  "tablesCsv": ["Item,Qty,Unit price,Amount\r\n\"A4 copy paper, box\",4,21.50,86.00\r\n..."],
  "tableCount": 1,
  "confidence": 99,
  "empty": false
}
```

- `source` is `text_layer` for digital pages and `ocr` for scans and photos.
- In `text`, table cells are separated by tabs, so the text also pastes cleanly into a spreadsheet.
- A file that can't be downloaded or opened gives one row with an `error` message.

### How much does it cost?

You pay **$3 per 1,000 pages that contain text** ($0.003 a page). Empty pages and files that fail are free. There is no separate OCR fee.

- A 1-page receipt photo: $0.003
- 500 scanned invoices of 2 pages: about $3
- A 200-page digital report: $0.60

You can set a maximum cost per run in Apify, and the Actor stops when it reaches it.

### Tips and limits

- **Best results:** scans at 200–300 DPI, or sharp photos taken straight on with even light.
- **Handwriting** is not supported. Printed and typed text only.
- **Tables that continue onto the next page** come out as one table per page.
- **Very faint or tiny print** may lose characters. Check the `confidence` value.
- **Password-protected PDFs** are not supported yet.
- Files up to 100 MB. **Max pages per file** (default 100) protects you from paying for a huge file by accident.

### Questions or problems?

Open an issue on the **Issues** tab with a link to a sample file (or a description if it's private). We read every one.

# Actor input Schema

## `fileUrls` (type: `array`):

Links to PDFs or images (JPG, PNG, TIFF, WebP, BMP). Scans, phone photos, screenshots and normal PDFs all work. Google Drive and Dropbox share links are turned into downloads automatically; the file must be shared so anyone with the link can open it.

## `uploadedFile` (type: `string`):

Upload a single PDF or image instead of giving a link.

## `languages` (type: `array`):

Pick the languages your documents are written in. English alone uses the most accurate engine for photos and receipts. Adding other languages keeps their accents and letters (for example ä, é, ß).

## `includeTables` (type: `boolean`):

Return tables, invoice lines and receipt items as rows of cells (JSON and CSV), also from scans and photos.

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

Stop reading a file after this many pages. You only pay for pages that are read and contain text.

## `failOnEmpty` (type: `boolean`):

Useful for scheduled checks: the run is marked as failed so you get an alert.

## Actor input object example

```json
{
  "fileUrls": [
    "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/02-scanned-invoice.pdf?signature=1qZ4uy3z9iRS6VdvU48gw",
    "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/07-receipt-photo.jpg?signature=gEy3Ve1WTL7H583Xyksr"
  ],
  "languages": [
    "eng"
  ],
  "includeTables": true,
  "maxPagesPerFile": 100,
  "failOnEmpty": false
}
```

# Actor output Schema

## `pages` (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 = {
    "fileUrls": [
        "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/02-scanned-invoice.pdf?signature=1qZ4uy3z9iRS6VdvU48gw",
        "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/07-receipt-photo.jpg?signature=gEy3Ve1WTL7H583Xyksr"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidelinedata/pdf-image-to-text-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 = { "fileUrls": [
        "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/02-scanned-invoice.pdf?signature=1qZ4uy3z9iRS6VdvU48gw",
        "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/07-receipt-photo.jpg?signature=gEy3Ve1WTL7H583Xyksr",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("tidelinedata/pdf-image-to-text-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 '{
  "fileUrls": [
    "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/02-scanned-invoice.pdf?signature=1qZ4uy3z9iRS6VdvU48gw",
    "https://api.apify.com/v2/key-value-stores/4deTrnxxbwKPezcQs/records/07-receipt-photo.jpg?signature=gEy3Ve1WTL7H583Xyksr"
  ]
}' |
apify call tidelinedata/pdf-image-to-text-ocr --silent --output-dataset

```

## MCP server setup

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