# PDF to Markdown Converter for RAG and AI Agents

**Use case:** 

Turn PDF, Word, PowerPoint, Excel, HTML and text files into clean Markdown, page-numbered chunks for citations and tables as JSON rows. Paste file URLs, or pick a dataset from any Actor that collects links. Scanned PDF pages are read by OCR when you leave it on. You pay per document converted, plus a small fee per 100 pages past the first 100 of a PDF. Files that fail are not charged.

## Input

```json
{
  "urls": [],
  "urlField": "",
  "ocr": true,
  "maxPages": 200,
  "maxFileSizeMb": 50,
  "maxItems": 1000
}
```

## Output

```json
{
  "title": {
    "label": "Title",
    "format": "string"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "pageCount": {
    "label": "Pages",
    "format": "integer"
  },
  "ocrPages": {
    "label": "OCR pages",
    "format": "integer"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "warnings": {
    "label": "Warnings",
    "format": "array"
  },
  "url": {
    "label": "File",
    "format": "string"
  },
  "markdown": {
    "label": "Markdown",
    "format": "string"
  }
}
```

## How it works

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

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

### 2. Start the "PDF to Markdown Converter for RAG and AI Agents" task

The PDF to Markdown: Word, Excel, PPTX, Tables & OCR Actor will start running based on the input automatically. You can also change all the input fields, like file urls, OCR scanned pages, and more, to match your specific use case.

### 3. Receive the "PDF to Markdown Converter for RAG and AI Agents" 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 title, format, pages, 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 "PDF to Markdown Converter for RAG and AI Agents" task via API](https://apify.com/verrr/document-to-markdown.md).

## FAQ

### Which file types can it convert?

PDF, DOCX, PPTX, XLSX, HTML and plain text. The type is detected from the file itself, so links without an extension work. Old .doc, .xls and .ppt files, images and password-protected files are reported as failed and not charged.

### How does it handle tables?

Word, Excel, PowerPoint and HTML tables are read from the file's own structure. In PDFs only clearly aligned columns are returned; anything less certain stays as text rather than a wrong table. Each table comes as JSON rows with its page.

### Can I run it after another Actor?

Yes. Pick that Actor's dataset in the Dataset field; a run can read only a dataset chosen there. It finds fields such as pdfUrl, fileUrl, url and link by itself, or you can name the field.

### How does OCR work and what does it cost?

A PDF page goes to OCR only if an image covers at least half of it and it has under 200 characters of text. Each page where OCR adds new text costs $0.007; if it adds nothing new, you pay nothing. The model is English.

### What do the chunks give me?

Each chunk is up to 1,500 characters of Markdown with its page number, ready to embed and cite. A chunk never crosses a page. Pages mean PDF pages, PPTX slides and XLSX sheets. Word, HTML and text files have no pages, so their page is null.

### What does a long PDF cost?

$0.003 covers a document and its first 100 pages. Each further block of 100 pages adds $0.003, so a 753-page PDF costs $0.024. Set Maximum pages to convert more than the first 200 pages.

## About this Actor

This example demonstrates how to use [PDF to Markdown: Word, Excel, PPTX, Tables & OCR](https://apify.com/verrr/document-to-markdown.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/verrr/document-to-markdown.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/verrr/document-to-markdown.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`).
