# PDF Text Extractor: PDF to Markdown & Text (`iscle/pdf-to-text-markdown`) Actor

PDF text extractor that converts PDF URLs to clean text or Markdown with headings, page by page, plus metadata (title, author, dates, page count) and links. Built for LLM, RAG and data pipelines. Failed or empty PDFs are free.

- **URL**: https://apify.com/iscle/pdf-to-text-markdown.md
- **Developed by:** [Iscle Beltran](https://apify.com/iscle) (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

Pay per event

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 Text Extractor: PDF to Markdown & Text

Turn PDF links into **clean text or Markdown**, page by page, with document metadata and links. Built for LLM prompts, RAG chunking, search indexing and data extraction from reports, papers, forms and invoices.

### Why this Actor

- **Markdown with headings:** titles and section headings are detected from font size, paragraphs are rebuilt and hyphenated line breaks joined.
- **One row per PDF or per page** (`splitPages`), perfect for RAG citations ("page 7").
- **Metadata:** title, author, subject, keywords, creator, producer, created/modified dates, page count, word count, links.
- **Scanned PDF detection:** `likelyScanned: true` when a PDF has almost no text layer (OCR is not included).
- **Fast:** a 15-page research paper in under 1 second.
- **Fair price:** flat price per PDF converted. Failed downloads, non-PDF links and PDFs without text are free.

### Input

| Field | Description |
|---|---|
| `pdfUrls` | Direct links to PDF files. |
| `outputFormat` | `markdown` (default) or `text`. |
| `splitPages` | One dataset row per page. |
| `includeLinks` | List hyperlinks found in the PDF. |
| `maxPagesPerPdf` | Default 300. |
| `maxFileSizeMb` | Default 50 MB. |
| `maxConcurrency` | PDFs in parallel (default 3). |

```json
{ "pdfUrls": ["https://arxiv.org/pdf/1706.03762", "https://www.irs.gov/pub/irs-pdf/fw9.pdf"], "outputFormat": "markdown" }
```

### Output

Real example from a test run on 18 Nov 2026 (content shortened):

```json
{
  "url": "https://arxiv.org/pdf/1706.03762",
  "status": "ok",
  "format": "markdown",
  "fileSizeBytes": 2215244,
  "pageCount": 15,
  "pagesExtracted": 15,
  "creator": "LaTeX with hyperref",
  "producer": "pdfTeX-1.40.25",
  "createdAt": "2024-04-10T21:11:43.000Z",
  "wordCount": 6161,
  "likelyScanned": false,
  "links": ["https://github.com/tensorflow/tensor2tensor", "…17 links"],
  "processingMs": 732,
  "content": "Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures in this paper solely for use in journalistic or scholarly works.\n\n# Attention Is All You Need\n\nAshish Vaswani ∗ Google Brain avaswani@google.com Noam Shazeer ∗ Google Brain …\n\nAbstract\n\nThe dominant sequence transduction models are based on complex recurrent or convolutional neural networks…"
}
```

In the same test the IRS Form W-9 (6 pages, 5,796 words in the first 5 pages) was split into one row per page; a web page link and a blocked link were reported as errors and not charged.

### Pricing (pay per event)

- **$0.002** per run start.
- **$0.003 per PDF converted** ($3 per 1,000 PDFs), whatever the number of pages up to `maxPagesPerPdf`.

### Notes

Text is read from the PDF text layer with pdf.js. Image-only (scanned) PDFs return little or no text and are not charged. Respect the copyright of the documents you process.

### Related Actors

- [Website to Markdown Converter for LLM & RAG](https://apify.com/iscle/url-to-markdown-llm): Convert any URL or PDF to clean Markdown for LLMs, RAG and AI agents. Removes menus and ads, keeps tables and links. Fast, no browser.
- [Google News Scraper: Real Article URLs, Any Country](https://apify.com/iscle/google-news-scraper): Scrape Google News by keyword or topic in any country and language. Headline, publisher, date and real article URL. Fast, no browser.

# Actor input Schema

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

Direct links to PDF files (http or https).

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

Markdown keeps headings and paragraphs, which LLMs and chunkers handle better.

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

Save one dataset row per page instead of one row per PDF (useful for RAG chunking and citations). Price stays per PDF.

## `includeLinks` (type: `boolean`):

List the hyperlinks found in the PDF.

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

Pages after this limit are skipped.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped (not charged).

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

PDFs processed at the same time.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "outputFormat": "markdown",
  "splitPages": false,
  "includeLinks": true,
  "maxPagesPerPdf": 300,
  "maxFileSizeMb": 50,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

All records saved to the default dataset.

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

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

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

```

## MCP server setup

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