# PDF Text Extractor – PDF to Text, Page by Page (`rowharbor1988/pdf-text-extractor`) Actor

Extract clean text and metadata from PDF files by URL – whole document or page by page, with page ranges.

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

## Pricing

from $0.70 / 1,000 pdf 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 Text Extractor – PDF to Text, Page by Page

Paste links to **PDF files** and get their **clean, readable text** in seconds, as one row per document or one row per page. Lines and paragraphs are rebuilt from the PDF layout, hyphenated line breaks are joined, and you also get useful metadata (title, page count, creation date, producer).

### Try it in one minute

1. Click **Try for free**. The input is already filled in with a public 14-page research paper (PDF), so you can start right away.
2. Click **Start**. A few seconds later you get one row per PDF. This is real output from that sample file (text shortened):

| fileName | pageCount | wordCount | creatorApp | isScanned | text |
|---|---|---|---|---|---|
| tracemonkey.pdf | 14 | 13,494 | TeX | false | "Trace-based Just-in-Time Type Specialization for Dynamic Languages …" |

3. Paste links to your own PDFs. Switch **Output** to *One row per page* if you need page numbers for chunking or citations. Download as **JSON, CSV or Excel**, or get the result via API.

**What it costs:** $0.001 per page extracted, i.e. $1 per 1,000 pages. The 14-page sample costs $0.014. Paid Apify plans get up to 30 % off. Apify's free plan includes monthly platform credit, so you can try it on your own documents at no cost.

**Ready-made setups:** [Convert PDF to text for AI and RAG](https://apify.com/rowharbor1988/pdf-text-extractor/examples/convert-pdf-to-text-for-ai) · [Extract PDF text page by page](https://apify.com/rowharbor1988/pdf-text-extractor/examples/extract-pdf-text-page-by-page)

### What you can use it for

- **AI and RAG pipelines**: turn reports, manuals, papers and contracts into text for embeddings, chatbots and summaries. Page-by-page output makes chunking and citing pages easy.
- **Search indexes**: make large PDF libraries searchable.
- **Document processing**: extract the text of invoices, price lists, tenders or annual reports for further parsing.
- **Monitoring**: combine with a scheduler to read the latest version of a PDF that is published at a fixed URL.

### Why this Actor

- **Clean text, not character soup**: lines, paragraphs and word spacing are reconstructed from the PDF coordinates, and hyphenation at line ends is repaired.
- **Page ranges**: extract only what you need (`1-3, 5, 10-`) and pay only for those pages.
- **Scanned PDFs are detected**: if a PDF has no text layer, it is flagged (`isScanned`) instead of silently returning nothing.
- **Clear errors**: password-protected files, broken links and "not actually a PDF" are reported per file in `SUMMARY`.
- **Fast and cheap**: no browser, built on Mozilla's pdf.js.
- **Privacy-friendly**: files are processed only during the run, and the personal metadata field *Author* is not output.

### Input

```json
{
  "pdfUrls": [
    { "url": "https://example.com/annual-report-2025.pdf" },
    { "url": "https://example.com/download?id=123" }
  ],
  "outputMode": "pages",
  "pageRange": "1-10"
}
```

| Field | Description |
|---|---|
| PDF URLs | Direct links to PDF files; download links work too |
| Output | One row per PDF (full text) or one row per page |
| Pages | e.g. `1-3, 5, 10-`; empty = all |
| Include per-page texts | In document mode, adds a `pages` array |
| Max pages per PDF | Default 500 |
| Max file size | Default 100 MB |

**Your own files**: upload them to an Apify key-value store (or any file host) and paste the links.

### Output

One row per PDF:

```json
{
  "url": "https://example.com/annual-report-2025.pdf",
  "fileName": "annual-report-2025.pdf",
  "fileSizeBytes": 1834221,
  "pageCount": 48,
  "pagesExtracted": 48,
  "title": "Annual Report 2025",
  "subject": null,
  "keywords": null,
  "creatorApp": "Microsoft® Word",
  "producer": "Adobe PDF Library",
  "createdAt": "2026-03-02T09:14:00.000Z",
  "modifiedAt": "2026-03-02T09:20:11.000Z",
  "language": "en-US",
  "pdfVersion": "1.7",
  "text": "Annual Report 2025\n\nLetter to shareholders\n…",
  "wordCount": 18234,
  "charCount": 121904,
  "isScanned": false
}
```

In page mode, each row contains `page`, `text`, `wordCount` and `charCount`. A per-file summary, including errors, is saved in the key-value store record `SUMMARY`.

### Pricing

You pay **per page extracted**: $0.001 per page ($1 per 1,000 pages). Files that fail (broken link, password-protected, not a PDF) are free. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### Limitations

- **No OCR**: scanned PDFs (images of text) are detected and flagged, but not converted to text.
- Password-protected PDFs cannot be read.
- Tables are returned as text lines, not as structured tables.
- Complex multi-column layouts are read in the order stored in the PDF, which is usually, but not always, the reading order.

### FAQ

**Can I process PDFs from my computer?** Upload them to an Apify key-value store or any file host (Google Drive public links that point directly to the file, Dropbox `?dl=1` links …) and paste the links.

**Is my data stored?** Only in your own run's dataset, under your control. The Actor does not keep copies.

**Something doesn't work?** Please open an issue with an example link and we will look into it.

# Actor input Schema

## `pdfUrls` (type: `array`):

Direct links to PDF files (https://…/file.pdf). Download links without .pdf work too, as long as they return a PDF. To process your own files, upload them to a key-value store or any file host and paste the links.

## `outputMode` (type: `string`):

One row per PDF with the full text, or one row per page.

## `pageRange` (type: `string`):

Only these pages, e.g. 1-3, 5, 10- . Empty = all pages. You only pay for pages extracted.

## `includePageTexts` (type: `boolean`):

Adds an array 'pages' with the text of each page to the document row.

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

Safety limit for very long documents.

## `maxFileMb` (type: `integer`):

Larger files are skipped.

## `maxConcurrency` (type: `integer`):

How many PDFs are processed at the same time.

## Actor input object example

```json
{
  "pdfUrls": [
    {
      "url": "https://raw.githubusercontent.com/mozilla/pdf.js/master/test/pdfs/tracemonkey.pdf"
    }
  ],
  "outputMode": "document",
  "includePageTexts": false,
  "maxPagesPerPdf": 500,
  "maxFileMb": 100,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "pdfUrls": [
        {
            "url": "https://raw.githubusercontent.com/mozilla/pdf.js/master/test/pdfs/tracemonkey.pdf"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowharbor1988/pdf-text-extractor").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 = { "pdfUrls": [{ "url": "https://raw.githubusercontent.com/mozilla/pdf.js/master/test/pdfs/tracemonkey.pdf" }] }

# Run the Actor and wait for it to finish
run = client.actor("rowharbor1988/pdf-text-extractor").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 '{
  "pdfUrls": [
    {
      "url": "https://raw.githubusercontent.com/mozilla/pdf.js/master/test/pdfs/tracemonkey.pdf"
    }
  ]
}' |
apify call rowharbor1988/pdf-text-extractor --silent --output-dataset

```

## MCP server setup

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

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/EbPuxOBWwAUJI9ZZP/builds/ZGcKkWYNw983AEhb6/openapi.json
