# PDF to Text & Markdown Converter - Bulk Extractor for RAG (`wood-between-studio/pdf-to-markdown`) Actor

Convert PDF URLs into clean plain text and LLM-ready Markdown with headings and lists, plus metadata and per-page text. Bulk, fast, page ranges, password PDFs. $2 per 1,000 PDFs.

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

## Pricing

$2.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 & Markdown Converter: Bulk PDF Extractor for LLMs & RAG

Turn **PDF URLs into clean plain text and LLM-ready Markdown** in bulk. Headings, paragraphs and bullet lists are rebuilt from the PDF layout. Metadata and optional per-page text come with every document. No API key and no setup.

### Why use it?

- **Markdown built for AI.** Headings are detected from font sizes, broken lines are joined back into paragraphs, lists are restored and page numbers are dropped. You can feed the output straight to embeddings, vector databases or prompts.
- **Bulk and fast.** Process many PDFs in parallel. A typical 15-page paper takes about a second.
- **Page ranges.** Extract `1-5, 8, 12-` instead of paying for a 400-page manual when you need three pages.
- **Password-protected PDFs** are supported.
- **Rich metadata:** title, author, subject, keywords, creator, producer, PDF version, and ISO creation and modification dates.
- **Scanned-PDF detection.** Image-only documents are flagged with `likelyScanned: true`, so you know which ones need OCR.
- **Low, flat price:** $2 per 1,000 PDFs. Failed downloads are never charged.

### Use cases

- RAG pipelines and AI agents (LangChain, LlamaIndex, custom GPTs and MCP clients)
- Research: batch-convert arXiv papers, reports and theses
- Legal and compliance: make filings, policies and contracts searchable
- Data pipelines: send text to Make, Zapier, n8n, Google Sheets or your own code through the Apify API

### Input

| Field | Default | Notes |
|---|---|---|
| `urls` | — | Direct links to `.pdf` files |
| `includeMarkdown` | `true` | Markdown rendition |
| `includeFullText` | `true` | Plain text |
| `includePerPageText` | `false` | `pages: [{page, text}]` |
| `pageRange` | all | e.g. `1-5, 8, 12-` |
| `maxPagesPerPdf` | 500 | Safety cap |
| `pdfPassword` | — | For protected files (stored as a secret) |
| `maxConcurrency` | 4 | Parallel PDFs |
| `maxPdfSizeMb` | 100 | Larger files are skipped and not charged |

#### Example

```json
{ "urls": ["https://arxiv.org/pdf/1706.03762"], "pageRange": "1-5", "includePerPageText": true }
```

### Output

```json
{
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "status": "success",
  "pageCount": 6,
  "extractedPageCount": 6,
  "metadata": { "title": "Form W-9 (Rev. March 2024)", "author": "SE:W:CAR:MP", "creationDate": "2024-03-...", "producer": "..." },
  "wordCount": 6284,
  "likelyScanned": false,
  "text": "Form W-9 (Rev. March 2024) ...",
  "markdown": "## Form W-9\n\n# Request for Taxpayer Identification Number and Certification\n\n..."
}
```

Failed items have `status: "failed"` and a clear `error`, such as HTTP 404, not a PDF, wrong password or too large.

### Pricing

**$2.00 per 1,000 PDFs converted** ($0.002 per PDF). Platform usage is included. Failed PDFs are free. Set a maximum charge per run if you want a hard cap.

### Limits

- Tables come out as text lines, not cells. Images aren't extracted.
- Scanned image-only PDFs have no text layer. They're flagged rather than OCRed.
- Very large documents (over about 3 million characters) are truncated to fit one dataset row and flagged with `truncated: true`. Use `pageRange` to split them.

### Responsible use

Only process PDFs you have the right to access. The Actor doesn't bypass logins, paywalls or DRM.

### Support

Want OCR, table extraction or file uploads? Open an issue on the **Issues** tab. We read every one.

### Call it from curl, JavaScript or Python

You can run this Actor in the [Apify Console](https://apify.com/wood-between-studio/pdf-to-markdown) with no code, or call it as an API from curl, JavaScript or Python. Replace `YOUR_TOKEN` with an [Apify API token](https://console.apify.com/account/integrations).

#### curl

```bash
curl "https://api.apify.com/v2/acts/wood-between-studio~pdf-to-markdown/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://arxiv.org/pdf/1706.03762"], "pageRange": "1-5"}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('wood-between-studio/pdf-to-markdown').call({
  "urls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "pageRange": "1-5"
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("wood-between-studio/pdf-to-markdown").call(run_input={
  "urls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "pageRange": "1-5"
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

You can also schedule the Actor, cap the spend per run, and send the dataset to Google Sheets, Slack or a webhook from the Console. Store page: [apify.com/wood-between-studio/pdf-to-markdown](https://apify.com/wood-between-studio/pdf-to-markdown).

# Actor input Schema

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

Direct links to PDF files, one per line. Redirects are followed.

## `includeMarkdown` (type: `boolean`):

Markdown with headings (from font sizes), paragraphs and lists. Great for LLMs, embeddings and RAG.

## `includeFullText` (type: `boolean`):

Full plain text of the document.

## `includePerPageText` (type: `boolean`):

Adds a 'pages' array with the text of each page (useful for citations).

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

Only these pages, e.g. '1-5, 8, 12-'. Empty = all pages.

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

Safety cap for very long documents.

## `pdfPassword` (type: `string`):

Optional. Used for password-protected PDFs.

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

How many PDFs to process at once.

## `timeoutPerPdfSecs` (type: `integer`):

Per PDF.

## `maxPdfSizeMb` (type: `integer`):

Larger files are skipped and reported as failed (not charged).

## Actor input object example

```json
{
  "urls": [
    "https://arxiv.org/pdf/1706.03762",
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "includeMarkdown": true,
  "includeFullText": true,
  "includePerPageText": false,
  "maxPagesPerPdf": 500,
  "maxConcurrency": 4,
  "timeoutPerPdfSecs": 120,
  "maxPdfSizeMb": 100
}
```

# 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 = {
    "urls": [
        "https://arxiv.org/pdf/1706.03762",
        "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("wood-between-studio/pdf-to-markdown").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",
        "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    ] }

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

```

## MCP server setup

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

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/ieB4pumoo495f7vDq/builds/lrrhDbzKnqNhdjZe8/openapi.json
