# PDF to Text Converter: Plain Text per Page, No Start Fee (`ucchiii/pdf-to-text`) Actor

Extract plain text from public PDF links: one row per page with the page number, text and character count, plus a full-text .txt file per PDF with a download link. Only pages with text are charged; scanned pages are free. Empty input = free demo.

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

## Pricing

from $0.35 / 1,000 extracted 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

**PDF to text, page by page: paste public PDF links and get the plain text of every page, plus one full-text .txt file per PDF.**

Each page becomes one row with the page number, the text and its character count, so you can search, filter or feed the text to an LLM page by page. Next to the rows, every PDF gets a `.txt` file with all its pages and a download link. No tables, no OCR, no layout guessing — just the text layer of the PDF, fast and cheap.

**Try it free:** leave the input empty and press **Start** — a small public PDF is converted (not charged, rows carry `_demo: true`).

### What you get

| url | page | text | charCount | scanned | textFileUrl |
|---|---|---|---|---|---|
| https://example.com/annual-report.pdf | 1 | Annual Report 2025\nRevenue grew 12% ... | 2,814 | false | https://api.apify.com/v2/key-value-stores/…/records/001-annual-report.txt |
| https://example.com/annual-report.pdf | 2 | Letter from the CEO\nDear shareholders ... | 3,102 | false | (same file) |
| https://example.com/annual-report.pdf | 3 | | 0 | true | (same file) |
| https://example.com/missing.pdf | 0 | | 0 | false | `error: http_404` |

*(illustrative rows showing the output format; the free demo shows real results)*

- **One row per page**: `url`, `page` (1-based), `text`, `charCount`, `scanned`, `textFileUrl`, `error`.
- **One .txt file per PDF** in the run's key-value store (`001-annual-report.txt`, `002-…`): all extracted pages in order, separated by a form-feed character (`\f`, the same page break `pdftotext` uses). The link is in every row of that PDF and in the `STATS` record.
- **Scanned pages are free**: a page that is only an image has no text layer; it comes back with empty `text`, `scanned: true` and is not charged. This Actor does not run OCR.

### How to use

1. **PDF URLs**: public links to PDF files, one per line (up to 500 per run).
2. Optional **Pages**: a range such as `1-5,8`, `3-` (page 3 to the end) or `-2` (the first two pages), applied to every PDF.
3. Optional **Max pages per PDF** (default 200, up to 2,000).

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "pages": "1-2",
  "maxPagesPerPdf": 200
}
```

### Output fields

- `url` — the PDF link you gave.
- `page` — page number (1-based); `0` on the single row of a PDF that could not be read.
- `text` — the page's text, with line breaks kept and surrounding white space trimmed.
- `charCount` — number of characters in `text`.
- `scanned` — `true` when the page has images but no text (a scan); `false` for text pages and blank pages.
- `textFileUrl` — download link of the PDF's full-text `.txt` file (empty when no page had text).
- `error` — `null`, or why the PDF or page failed: `http_404`, `not_a_pdf`, `file_too_large`, `timeout`, `encrypted`, `unreadable_pdf`, `blocked_private_address`, `invalid_url`, `page_failed:…`.
- **STATS** record: per PDF the page count, pages extracted, pages with text, pages charged, scanned pages, the `.txt` file and any error.

### Limits (cannot be raised by input)

- Up to **500 PDFs per run**, each up to **50 MB**, downloaded once within **60 seconds**, following at most 5 redirects.
- Up to **2,000 pages per PDF** (`maxPagesPerPdf`, default 200).
- Public files only: no login, no cookies. Password-protected PDFs return `encrypted`. Links to internal network addresses are blocked.
- Set a **maximum charge per run** to cap spend: the Actor checks it before it starts, stops cleanly when it is reached and keeps the pages read so far.
- Very long jobs: dense pages take a fraction of a second each; for thousands of pages per run, raise the run timeout (default 1 hour).

### Pricing

Pay per event: **$0.0005 per extracted page** — a page that contains text. That is **$0.50 per 1,000 pages**; a 10-page PDF costs half a cent. No start fee and no per-file fee.
Blank pages, scanned (image-only) pages, PDFs that fail to download or open, and the demo are **free**.
Store discounts apply automatically: BRONZE −10%, SILVER −20%, GOLD −30%.
On the Apify Free plan, the $5 of monthly platform credit covers about 10,000 pages a month.

### FAQ

**Does it read scanned PDFs?** No. Scans have no text layer and need OCR, which this Actor does not do. Those pages are flagged `scanned: true` and cost nothing, so you can see which documents need OCR.

**Does it extract tables?** No — table cells come out as plain text lines in reading order. If you need tables as rows and cells, use the PDF Extractor Actor from the same developer.

**Why is the text order sometimes odd?** The text is read from the PDF's own text layer. Multi-column layouts and text in floating boxes are put in reading order line by line, which can mix columns on some documents.

**Can I give a local file?** Upload it somewhere public first (for example an Apify key-value store or any file host) and paste the link.

**Who owns the text?** The rights stay with the owners of the documents. Only process PDFs you are allowed to use.

If this Actor saved you time, a rating on the Store helps others find it.

### More tools from the same developer

- [PDF Extractor](https://apify.com/ucchiii/pdf-extractor) — PDF to text, tables and metadata from public PDF URLs, page by page
- [OCR Image to Text](https://apify.com/ucchiii/ocr-image-text) — OCR for image URLs and scanned PDFs with built-in Tesseract: text, confidence and line boxes in 8 languages
- [RAG Chunker](https://apify.com/ucchiii/rag-chunker) — split scraped pages into chunks for RAG and vector stores

# Actor input Schema

## `urls` (type: `array`):

Public PDF links (http:// or https://), one per line. Each PDF is downloaded once (max 50 MB, 60 s, up to 5 redirects). Up to 500 PDFs per run. Leave empty for a free demo on a small public PDF (not charged).

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

Optional page range, 1-based, applied to every PDF: '1-5,8', '3-' (page 3 to the end) or '-2' (first two pages). Empty = all pages, up to the limit below. Pages past the end of a PDF are ignored.

## `maxPagesPerPdf` (type: `integer`):

Read at most this many pages of each PDF (1 to 2,000, default 200). Caps your cost on very long documents.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "maxPagesPerPdf": 200
}
```

# Actor output Schema

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

One item per PDF page: url, page, text, charCount, scanned, textFileUrl, error. A PDF that could not be read gives one item with page 0 and the error.

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

The key-value store with one .txt file per PDF (all extracted pages, separated by a form-feed character).

## `stats` (type: `string`):

Record STATS: per PDF the page count, pages extracted, pages charged, scanned pages, .txt file link and error.

# 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 = {
    "urls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/pdf-to-text").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 = { "urls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/pdf-to-text").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 '{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call ucchiii/pdf-to-text --silent --output-dataset

```

## MCP server setup

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

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/WUPoACwTEizlWSjA8/builds/h7n3cPii2s7bK3Mmc/openapi.json
