# PDF to Text — Extract Text from PDFs in Bulk (`actor-forge/pdf-to-text`) Actor

Extract plain text from PDF URLs in bulk: whole document or page by page, reading order kept, plus title, author, page count and dates. Paste a web page to convert every PDF it links to. $3 per 1,000 PDFs + $0.20 per 1,000 pages.

- **URL**: https://apify.com/actor-forge/pdf-to-text.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** AI, Developer tools, Integrations
- **Security:** 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 pdf converteds

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 to Text — Extract Text from PDFs in Bulk

Extract plain text from PDF URLs in bulk: whole document or page by page, reading order kept, plus title, author, page count and dates. Paste a web page to convert every PDF it links to. $3 per 1,000 PDFs + $0.20 per 1,000 pages.

**Extract text from PDFs in bulk.** Paste links to **PDF files** (reports, papers, manuals, filings, invoices) or a web page that links to them, and get the **plain text** of every PDF back, as one document or **page by page**, in reading order (two-column papers included) with hyphenated line breaks joined. Each row also has the PDF's **title, author, page count, creation and modification dates** and word count. Need structure? Switch on **Markdown** output (headings and lists) or **RAG chunks** for embedding in the same run. Scanned PDFs without a text layer are flagged and never charged (use our [PDF OCR](https://apify.com/actor-forge/pdf-ocr) actor for those). Use it to feed PDFs to **LLMs, RAG pipelines and AI agents**, build search indexes, check documents for keywords, or add a PDF-to-text step to **Make, n8n and Zapier**. **Simple pricing: $3 per 1,000 PDFs plus $0.20 per 1,000 pages**, with no compute bill on top (a 10-page PDF is $0.005, against $0.01–$0.015 at the leading bulk PDF text extractors). Failed downloads, corrupt and scanned-only files are never charged.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| url | title | pageCount | wordCount | text |
| --- | --- | --- | --- | --- |
| https://arxiv.org/pdf/1706.03762 | Attention Is All You Need | 15 | 5811 | Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures… |
| https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.29.pdf | The NIST Cybersecurity Framework (CSF) 2.0 | 32 | 9027 | The NIST Cybersecurity Framework (CSF) 2.0\nNational Institute of Standards and Technology… |
| https://www.irs.gov/pub/irs-pdf/fw9.pdf | Form W-9 (Rev. March 2024) | 6 | 6239 | Form W-9\n(Rev. March 2024)\nRequest for Taxpayer Identification Number and Certification… |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `pdf-converted` | $0.003 | per PDF converted and delivered (all output formats and chunks included) | 1,000 PDFs = $3.00 + their pages |
| `page-converted` | $0.0002 | per page with text converted (scanned pages without text are free) | A 10-page PDF = $0.003 + 10 × $0.0002 = $0.005; a 100-page report = $0.023 |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 4 GB = $0.0002 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `urls` | array | yes | — | Links to PDF files. You can also add a web page (e.g. a reports or publications page): every PDF it links to is converted. |
| `outputMode` | string | no | `"document"` | One row per PDF (whole document), or one row per page (handy for page-level citations). |
| `outputFormats` | array | no | `["text"]` | Which content fields to return. Same price whatever you pick. |
| `chunkSize` | integer | no | `0` | Also split each PDF into chunks (one-row-per-PDF mode only) of at most this many characters for embedding, split at headings and paragraphs, each with its heading path. 0 = no chunks. Around 1,500–4,000 suits most embedding models. |
| `includePages` | boolean | no | `false` | In one-row-per-PDF mode, also add a pages array with each page's Markdown/text and word count. |
| `maxPagesPerPdf` | integer | no | `1000` | Convert at most this many pages of each PDF (from the start). Longer PDFs are marked truncated. |
| `maxPdfs` | integer | no | `1000` | Stop after converting this many PDFs (including ones found on web pages). |
| `findPdfLinks` | boolean | no | `true` | When a URL is a web page rather than a PDF, convert the PDFs it links to (one level, robots.txt respected). |
| `password` | string | no | — | For password-protected PDFs you are entitled to open. Used for every PDF in the run. |

### Limits & honest notes

- Text is read from the PDF's text layer. Scanned PDFs (images of pages) have no text layer: they are reported and not charged. For those, use our OCR to Text actor (apify.com/actor-forge/ocr-to-text).
- Tables come out as lines of text in reading order, not as Markdown tables. Images and figures are skipped. Mathematical formulas come out as their plain characters.
- Headings are inferred from the layout. Font sizes, section numbers such as "3.1", and the PDF's bookmarks all count, but bold text at body size without numbering stays a paragraph.
- PDFs up to 100 MB and up to 5,000 pages each (1,000 by default). Password-protected PDFs need the password input.
- Web pages in the input are scanned for links to .pdf files (one level deep, robots.txt respected). If a site's robots.txt can't be fetched (HTTP 5xx or a network error, after one retry), the PDFs linked on that site are skipped (RFC 9309) and the page gets a free row saying why. Pages behind a login are not supported.
- Respects your run budget: set a maximum total charge and conversion stops cleanly at the cap, with no PDF charged twice.

### Related ActorForge actors

- [PDF to Markdown](https://apify.com/actor-forge/pdf-to-markdown) — structured Markdown and RAG chunks
- [PDF OCR](https://apify.com/actor-forge/pdf-ocr) — for scanned PDFs
- [Word, Excel & PowerPoint to Markdown](https://apify.com/actor-forge/office-to-markdown)

### Changelog

- **2026-10-18** — Initial release: layout-aware Markdown (headings, paragraphs, lists, table of contents), header/footer removal, metadata, plain text, per-page and per-PDF rows, RAG chunks, PDF-link discovery on web pages.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

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

Links to PDF files. You can also add a web page (e.g. a reports or publications page): every PDF it links to is converted.

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

One row per PDF (whole document), or one row per page (handy for page-level citations).

## `outputFormats` (type: `array`):

Which content fields to return. Same price whatever you pick.

## `chunkSize` (type: `integer`):

Also split each PDF into chunks (one-row-per-PDF mode only) of at most this many characters for embedding, split at headings and paragraphs, each with its heading path. 0 = no chunks. Around 1,500–4,000 suits most embedding models.

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

In one-row-per-PDF mode, also add a pages array with each page's Markdown/text and word count.

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

Convert at most this many pages of each PDF (from the start). Longer PDFs are marked truncated.

## `maxPdfs` (type: `integer`):

Stop after converting this many PDFs (including ones found on web pages).

## `findPdfLinks` (type: `boolean`):

When a URL is a web page rather than a PDF, convert the PDFs it links to (one level, robots.txt respected).

## `password` (type: `string`):

For password-protected PDFs you are entitled to open. Used for every PDF in the run.

## Actor input object example

```json
{
  "urls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "outputMode": "document",
  "outputFormats": [
    "text"
  ],
  "chunkSize": 0,
  "includePages": false,
  "maxPagesPerPdf": 1000,
  "maxPdfs": 1000,
  "findPdfLinks": true
}
```

# Actor output Schema

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

One row per PDF (or page) with clean Markdown, optional plain text, per-page content and RAG chunks, plus metadata.

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

PDFs and pages converted, URLs that failed or were skipped, and skip reasons (none of them charged).

# 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://arxiv.org/pdf/1706.03762"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/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://arxiv.org/pdf/1706.03762"] }

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/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://arxiv.org/pdf/1706.03762"
  ]
}' |
apify call actor-forge/pdf-to-text --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,actor-forge/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/9mSUChrT7b2MFK0Zn/builds/kbsyQsgsK7Zv1OwoR/openapi.json
