# Convert a PDF to Markdown for LLMs and RAG

**Use case:** 

Turn a PDF link (here the paper Attention Is All You Need) into clean Markdown, one row per page, ready to chunk and embed for RAG or to paste into ChatGPT or Claude. Tables become Markdown tables. Fast, no browser, no proxy.

## Input

```json
{
  "urls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "outputMode": "page",
  "extractTables": true,
  "keepLayout": false,
  "pageRange": "1-6",
  "includePageTexts": false,
  "maxPagesPerPdf": 300,
  "maxFileSizeMb": 50,
  "maxConcurrency": 3,
  "parseTimeoutSecs": 180
}
```

## Output

```json
{
  "fileName": {
    "label": "File",
    "format": "string"
  },
  "page": {
    "label": "Page",
    "format": "integer"
  },
  "markdown": {
    "label": "Markdown",
    "format": "string"
  },
  "text": {
    "label": "Text",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The PDF to Text, Markdown & Tables Extractor Actor is ready to run with the inputs already set for "Convert a PDF to Markdown for LLMs and RAG". [Sign up or log in](https://console.apify.com/create-task-from-example/T80uVjAkE2zatamyE) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert a PDF to Markdown for LLMs and RAG" task

The PDF to Text, Markdown & Tables Extractor Actor will start running based on the input automatically. You can also change all the input fields, like PDF URLs, one row per, and more, to match your specific use case.

### 3. Receive the "Convert a PDF to Markdown for LLMs and RAG" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as file, page, markdown, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Convert a PDF to Markdown for LLMs and RAG" task via API](https://apify.com/pennapixel/pdf-tables-extractor.md).

## FAQ

### Why one row per page?

Page mode gives you ready-made chunks with their page number, handy for RAG and for citing the source page. Switch to Document mode to get one row per PDF instead.

### Can I send many PDFs in one run?

Yes, add as many links as you want: they are read in parallel and each one gets its own rows.

## About this Actor

This example demonstrates how to use [PDF to Text, Markdown & Tables Extractor](https://apify.com/pennapixel/pdf-tables-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/pennapixel/pdf-tables-extractor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/pennapixel/pdf-tables-extractor.md

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`).
