# PDF to Markdown and Text Converter (for AI and RAG) (`tenderwire/pdf-to-markdown`) Actor

Convert PDFs to clean Markdown and plain text with headings, lists and metadata. Paste PDF links, get one result per document or per page. Fast, no OCR needed for digital PDFs. Pay per page.

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

## Pricing

$1.00 / 1,000 pages

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 Markdown and Text Converter (for AI and RAG)

Turn PDFs into **clean Markdown and plain text** you can feed straight into ChatGPT, Claude, a vector database or any document pipeline. Paste PDF links and get, for each document, the full text, a Markdown version that keeps headings, paragraphs and bullet lists, and the document's metadata (title, author, dates, page count).

Built on Mozilla's pdf.js for reliable text extraction: fast, no browser, and you **only pay for the pages converted**.

### What does PDF to Markdown do?

- Downloads each PDF from its link and reads the text layer of every page.
- Rebuilds lines and paragraphs from the text positions, joins words split across lines, and turns large fonts into `#` / `##` / `###` headings and bullet characters into `-` list items.
- Returns one result per document (pages separated by `---`) or **one result per page** for chunking and page-level citations.
- Adds metadata: title, author, subject, keywords, creator, producer, created and modified dates, page count.
- Reports problems per file (not a PDF, download failed, scanned image without text) without failing the run.

### Who uses it?

- **AI and RAG builders** preparing documents for embeddings and retrieval.
- **No-code automations** (Make, Zapier, n8n) that need the text of invoices, reports, contracts or filings.
- **Researchers and analysts** extracting text from reports and papers in bulk.
- **Developers** who want a hosted PDF-to-text API without running their own parser.

### What data do you get?

| Field | Example |
|---|---|
| url, fileName | https://www.irs.gov/pub/irs-pdf/fw9.pdf, fw9.pdf |
| title | Form W-9 (Rev. March 2024) |
| pageCount, pagesConverted | 6, 6 |
| markdown | Markdown with headings and lists |
| text | plain text, line by line |
| meta | title, author, subject, keywords, creator, producer, createdAt, modifiedAt |
| page | page number when One result per page is on |
| charCount | number of characters extracted |
| error | what went wrong for this file, if anything |

### How to use it

1. Click **Try for free**.
2. Paste PDF links into **PDF URLs**, one per line.
3. Choose Markdown, text or both, and whether you want one result per page.
4. Click **Start**. A typical 10-page PDF converts in about a second.
5. Get the results as JSON, CSV or Excel, or through the Apify API from your app or automation.

### Input example

```json
{
    "urls": [
        "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
        "https://example.org/annual-report-2025.pdf"
    ],
    "outputFormat": "markdown",
    "splitPages": true,
    "maxPagesPerDocument": 200
}
```

### Output example

```json
{
    "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    "fileName": "fw9.pdf",
    "page": null,
    "pageCount": 6,
    "pagesConverted": 6,
    "title": "Form W-9 (Rev. March 2024)",
    "meta": {
        "title": "Form W-9 (Rev. March 2024)",
        "author": "SE:W:CAR:MP",
        "subject": "Request for Taxpayer Identification Number and Certification",
        "keywords": "Fillable",
        "creator": "Designer 6.5",
        "producer": "Designer 6.5",
        "createdAt": "2024-03-06T13:18:13.000Z",
        "modifiedAt": "2024-03-06T13:18:13.000Z"
    },
    "markdown": "# Request for Taxpayer  Give form to the\n\n# Form W-9\n\n# (Rev. March 2024)  Identification Number and Certification  requester. Do not\n\nDepartment of the Treasury  send to the IRS. Internal Revenue Service Go to www.irs.gov/FormW9 for instructions and the...",
    "text": "Request for Taxpayer  Give form to the\nForm W-9\n(Rev. March 2024)  Identification Number and Certification  requester. Do not\nDepartment of the Treasury  send...",
    "charCount": 37955,
    "error": null,
    "scrapedAt": "2026-11-05T15:30:00.000Z"
}
```

### How much does it cost?

**Pay per page: $1 per 1,000 pages converted** (one tenth of a cent per page), plus a tiny Apify start fee per run.

- A 10-page document costs $0.01. A 300-page book costs $0.30.
- Use **Max pages per document** to convert only the first pages.
- Failed downloads and non-PDF links are not charged.
- Apify's free plan includes monthly credit, enough to convert thousands of pages.

### Use it from your app or AI agent

Call the Actor through the Apify API, or connect it to Make, Zapier, n8n, LangChain or LlamaIndex with Apify's integrations. AI agents can also run it through the Apify MCP server.

### FAQ

**Does it do OCR on scanned PDFs?**
No. It reads the text layer that digital PDFs contain (exported from Word, Google Docs, LaTeX, reporting tools and most web PDFs). Scanned images without text are reported with an error instead of empty text.

**How good is the Markdown for complex layouts?**
Headings, paragraphs and lists come out well for normal documents. Multi-column layouts, forms and tables are converted line by line, so table cells appear as text on one line rather than as a Markdown table.

**Can I convert PDFs from my computer?**
Upload them anywhere that gives you a link (for example an Apify key-value store, Google Drive with a direct download link, or S3), then paste the links.

**Do you keep my documents?**
The Actor only processes the files during your run. Results are stored in your own Apify account under your data retention settings.

**Something looks wrong?**
Open an issue on the Issues tab with the PDF link. An automatic self-check runs every day.

# Actor input Schema

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

Links to PDF files, one per line. Files you have on your computer: upload them to any file host or an Apify key-value store and paste the link.

## `outputFormat` (type: `string`):

Markdown keeps headings and lists (best for AI, RAG and chat with documents). Text is plain text, line by line.

## `splitPages` (type: `boolean`):

Output each page as its own item (handy for chunking and page citations). Off = one item per document, pages separated by ---.

## `maxPagesPerDocument` (type: `integer`):

Convert only the first N pages of each PDF. You pay only for pages converted.

## `maxDocuments` (type: `integer`):

Stop after this many documents.

## `proxyConfiguration` (type: `object`):

Only needed if a website blocks downloads.

## `selfCheck` (type: `boolean`):

For the maintainer. Converts two known PDFs and checks the results. Charges nothing.

## Actor input object example

```json
{
  "urls": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "outputFormat": "both",
  "splitPages": false,
  "maxPagesPerDocument": 500,
  "maxDocuments": 1000,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "selfCheck": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `allFields` (type: `string`):

No description

## `selfCheck` (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://www.irs.gov/pub/irs-pdf/fw9.pdf"
    ]
};

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

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

```

## MCP server setup

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