# PDF to Markdown & Text Extractor - Bulk PDFs for RAG & LLMs (`technicaldost/pdf-to-markdown-text-extractor`) Actor

Convert PDF URLs to clean Markdown or plain text in bulk, with headings, lists, metadata and ready-made RAG chunks. Give a web page and it finds and extracts every linked PDF. No start fee; failed files are free.

- **URL**: https://apify.com/technicaldost/pdf-to-markdown-text-extractor.md
- **Developed by:** [Technical Dost Solutions](https://apify.com/technicaldost) (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

from $2.00 / 1,000 pdf extracteds

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 & Text Extractor - Bulk PDFs for RAG & LLMs

**Try it now:** the prefilled input converts the 15-page *Attention Is All You Need* paper to Markdown in about 5 seconds for **$0.002**.

Convert **PDF URLs to clean Markdown or plain text** in bulk — ready for LLMs, RAG pipelines, vector databases, search indexes and analysis. Headings, numbered sections and bullet lists are preserved, running headers/footers and page numbers are removed, hyphenated line breaks are joined, and every document comes with its metadata.

**Give it a web page instead of a PDF** (an investor-relations page, a documentation hub, a government publications list, an arXiv listing) and it **finds and extracts every linked PDF** automatically.

### Who uses it

- **AI / RAG builders** – turn PDF libraries into Markdown chunks for embeddings (built-in chunking with overlap).
- **Analysts and investor relations** – bulk-extract annual reports, 10-Ks, ESG and earnings PDFs from company pages.
- **Researchers** – extract papers from arXiv, journals and university repositories.
- **Compliance and legal** – full-text search over policies, contracts and regulatory PDFs (SHA-256 hash included).
- **Automation** – a "PDF → text" step for Make, n8n, Zapier, LangChain or LlamaIndex via the Apify API.

### Features

- **Markdown** (headings `#`–`####`, lists, paragraphs) or **plain text**, or both
- **PDF link discovery** from any web page
- **RAG chunks** at paragraph/sentence boundaries with configurable size and overlap
- Metadata: title, author, subject, producer, creator, creation and modification dates, page count, word count
- **Scanned-PDF detection** (`isScanned`) so you know which files need OCR
- Page ranges (`1-5,8,10-end`), per-page output, size and page limits
- **No start fee. Failed downloads, non-PDF links and oversize files are free.**

### Input example

```json
{
  "urls": [
    "https://arxiv.org/pdf/1706.03762",
    "https://arxiv.org/list/cs.CL/new"
  ],
  "outputFormat": "markdown",
  "maxPdfsPerPage": 10,
  "chunkSize": 1500,
  "chunkOverlap": 150
}
```

### Output example

```json
{
  "url": "https://arxiv.org/pdf/1706.03762",
  "fileName": "1706.03762",
  "producer": "pdfTeX-1.40.25",
  "creationDate": "2024-04-10T21:11:43Z",
  "pageCount": 15,
  "wordCount": 6087,
  "isScanned": false,
  "markdown": "## Attention Is All You Need\n\n...\n\n#### 3.2.1 Scaled Dot-Product Attention\n\nWe call our particular attention ...",
  "chunks": [{ "index": 0, "text": "...", "charStart": 0, "charEnd": 1496 }],
  "sha256": "bdfaa68d...",
  "error": null
}
```

Views: **Documents** (metadata overview) and **Markdown content**. Very large documents also get a `fullTextUrl` to the complete Markdown file.

### Pricing

| Event | Price |
|---|---|
| PDF extracted (includes the first 50 pages) | **$0.002** |
| Each additional page beyond 50 | $0.0002 |

A 15-page paper costs $0.002; a 200-page annual report costs $0.032. Nothing is charged for files that fail.

### Notes

- Text is read from the PDF's text layer. Scanned PDFs (images of pages) contain no text layer and are flagged with `isScanned: true` — run their page images through an OCR Actor such as **Image to Text OCR**.
- Complex layouts (multi-column, tables) are converted in reading order; tables become text lines.
- Password-protected PDFs cannot be read.

***

Found it useful? A short review on the Store helps others find it. Problems or ideas → the Issues tab.

# Actor input Schema

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

Direct PDF links, or web pages that link to PDFs (annual reports, investor-relations, documentation, government pages).

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

Markdown keeps document structure; plain text keeps line breaks.

## `discoverPdfLinks` (type: `boolean`):

When a URL is a web page, extract every PDF it links to.

## `maxPdfsPerPage` (type: `integer`):

Limit for PDF links taken from each web page.

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

Optional, e.g. 1-5,8,10-end. Empty = all pages.

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

Stops very long documents at this page.

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

Split each document into chunks for embeddings, at paragraph or sentence boundaries. 0 = off. Try 1500.

## `chunkOverlap` (type: `integer`):

Characters repeated between consecutive chunks.

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

Adds a pages array with Markdown and text for every page (bigger rows).

## `maxPdfMb` (type: `integer`):

Larger files are skipped and not charged.

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

Upper limit across all inputs.

## Actor input object example

```json
{
  "urls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "outputFormat": "markdown",
  "discoverPdfLinks": true,
  "maxPdfsPerPage": 20,
  "maxPagesPerPdf": 500,
  "chunkSize": 0,
  "chunkOverlap": 150,
  "includePages": false,
  "maxPdfMb": 50,
  "maxPdfs": 1000
}
```

# Actor output Schema

## `documents` (type: `string`):

One row per PDF with metadata, word count and scan detection.

## `markdown` (type: `string`):

Extracted Markdown per PDF.

## `json` (type: `string`):

Markdown, text, pages and RAG chunks.

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

PDFs found, extracted and failed, with errors.

# 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("technicaldost/pdf-to-markdown-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 = { "urls": ["https://arxiv.org/pdf/1706.03762"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,technicaldost/pdf-to-markdown-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/qviV1osgHJn2M6Tl6/builds/EEcYpxybf3HzRKw9c/openapi.json
