# Documents to Text for AI - PDF, Word, PowerPoint to Markdown (`scath/documents-to-text`) Actor

Turn PDF, Word, PowerPoint, Excel, HTML, text files and scanned images from URLs into clean Markdown with tables, metadata and OCR. Files are never kept.

- **URL**: https://apify.com/scath/documents-to-text.md
- **Developed by:** [Scath](https://apify.com/scath) (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 $3.00 / 1,000 page converteds

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

## Documents to text for AI apps

Give it links to PDF, Word, PowerPoint, Excel, HTML, text files or scanned images. You get one record per file with clean Markdown text, tables, metadata, a language guess and a word count, ready to feed to a language model or a search index. Scanned PDFs and PNG/JPG images are read with OCR.

### What it does

- Reads **PDF** (text and scanned), **DOCX**, **PPTX**, **XLSX**, **HTML**, **TXT** and **PNG/JPG** files from the links you give. It downloads only those links, nothing else.
- Returns Markdown: headings for Word and HTML, slide titles and speaker notes for PowerPoint, one table per sheet for Excel, bullet lists, and **bordered tables as Markdown tables** (PDF, Word, PowerPoint, HTML).
- Returns page count, optional per-page text, title, author and creation date (only when the file's own properties contain them), language guess, word count, whether OCR was used, and warnings.
- Everything runs inside the Actor on CPU. No outside AI service is called and no file leaves the run.

### Privacy

Your files may be sensitive. The Actor does not write document text to its logs (logs only show a file number, the web host name and page counts), does not keep any file after it is converted (each download is deleted straight away and the temporary folder is removed at the end of the run), and sends nothing to third parties. The only place the text is stored is your run's dataset, which you control. Note the dataset also holds the link you provided; if a link contains a secret token, delete the dataset when you are done or use short-lived links.

### Input

| Field | Type | Description |
|---|---|---|
| `urls` | list of text | Direct http/https links, one per line. Required (up to 1,000). |
| `ocr` | `auto` / `off` / `force` | `auto` (default) OCRs pages that have no text layer. |
| `ocr_languages` | text | Tesseract codes, e.g. `eng` (default) or `eng+deu`. Installed: eng, deu, fra, spa, ita, por, nld. |
| `include_pages` | true/false | Add per-page text (per slide / sheet). Default false. |
| `extract_tables` | true/false | Detect bordered tables in PDFs. Default true. |
| `page_markers` | true/false | Add `<!-- page N -->` before each page in the Markdown. Default false. |
| `max_results` | whole number | Stop after this many delivered documents (default 100, max 1000). |
| `max_file_mb` | whole number | Largest file accepted (default 25, max 100). |
| `max_pages_per_file` | whole number | Only the first N pages are converted and charged (default 100, max 1000). |
| `timeout_seconds` | whole number | Time limit per file (default 180, max 600). Pages finished so far are returned. |
| `concurrency` | whole number | Files converted at once (default 2, max 4). |

```json
{ "urls": ["https://example.com/report.pdf", "https://example.com/scan.jpg"], "ocr": "auto", "include_pages": false }
```

### Output

One record per link, in input order. Failed links also get a record (`status: "failed"` with a plain-English `error`) and are **not charged**. Shortened example (full example in `sample_output.json`):

```json
{
  "url": "https://example.com/report.pdf", "file_name": "report.pdf", "file_type": "pdf", "status": "ok", "error": null,
  "title": "Synthetic Report", "author": "Test Author", "created": "2026-11-17T21:38:03",
  "language": "en", "word_count": 499, "page_count": 3, "page_count_basis": "native", "pages_converted": 3,
  "ocr_used": false, "ocr_pages": 0, "size_bytes": 3546,
  "markdown": "Section 1: Quarterly overview\n...\n\n| Item | Qty | Price |\n| --- | --- | --- |\n| Widget | 4 | 9.50 |",
  "tables": [{ "page": 1, "markdown": "| Item | Qty | Price |\n..." }],
  "pages": null, "warnings": []
}
```

Fields: `url`, `file_name`, `file_type` (pdf, docx, pptx, xlsx, html, text, image; detected from the file content, not the name), `status`, `error`, `title`, `author`, `created` (null unless the file's own metadata has it), `language` (ISO 639-1 or null if too little text), `word_count`, `page_count` (pages in the original), `page_count_basis` (`native`, `estimated` for Word files without a stored page count, or `single` for files without pages), `pages_converted` (pages delivered and charged), `ocr_used`, `ocr_pages`, `size_bytes`, `markdown`, `tables` (page and Markdown), `pages` (only with `include_pages`), `warnings`.

### Pricing

Pay per event; you are charged only for pages delivered:

- **page-converted**: one per page delivered. PDF pages, PowerPoint slides and Excel sheets count one each; Word files count by their page count; HTML, text and images count as one page.
- **page-ocr**: one extra for every page that needed OCR (so an OCR page pays both events).
  Failed files, empty results and files over the limits are free. Set a maximum cost per run and the Actor stops cleanly when it is reached. Prices are shown on the Store page.

### Limits and safety

- Default maximum file size 25 MB (up to 100), 100 pages per file (up to 1,000), 180 seconds per file (up to 600).
- Every file is converted in a separate, memory-limited process with a hard time limit; damaged, oversized or hostile files (zip bombs, huge images, password-protected PDFs) fail with a message and do not stop the run.
- Links to private or local network addresses are refused. Old binary Office files (.doc, .xls, .ppt) are not supported; save them as .docx/.xlsx/.pptx.

### Honest notes

- Tested on synthetic documents we generated, not on a wide range of real-world files. OCR was tested on clean, computer-rendered English text only; accuracy on poor scans, handwriting, or non-English languages was not measured.
- PDF headings are not detected (the text is returned as paragraphs). Only bordered tables are found; tables made of spacing alone come out as plain text. Multi-column PDFs may read in the wrong order.
- Pictures inside Word and PowerPoint files are not OCR'd (a warning says so). Excel formulas show the value Excel last saved. Hidden sheets are skipped.
- Word and PowerPoint page counts for billing come from the file (or, for Word without a stored count, an estimate of about 450 words per page).
- Audio and video files are not supported.
- The Actor reads only the links you list. It does not log in, crawl, or bypass blocks, and it collects no contact details. The author field is returned only when the file's own properties contain it.

### Frequently asked questions

#### How much does it cost to convert a PDF to Markdown?

$3.00 per 1,000 pages converted, and $5.00 per 1,000 scanned pages read with OCR. Files that cannot be downloaded or read are free.

#### Which file types are supported?

PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx), HTML, plain text, and images (PNG, JPG, TIFF) with OCR.

#### Is it good for RAG and AI apps?

Yes. Output is clean Markdown with headings and tables kept, which is what vector databases, ChatGPT, Claude and other LLMs work best with. Page markers can be added so you can cite page numbers.

#### Are my files stored?

No. Files are downloaded, converted in memory and thrown away. Only the text you asked for is saved in your own dataset.

#### Can I use it from code, Zapier, Make or n8n?

Yes, through the Apify API, the Python or JavaScript client, or any Apify integration. AI agents can also call it through the Apify MCP server.

### More tools by Scath

- [Company Jobs Scraper](https://apify.com/scath/company-jobs-feed): every open job from a company's career page (Greenhouse, Lever, Workable and 8 more hiring systems), with hiring summaries
- [Website Tech Stack Lookup](https://apify.com/scath/website-tech-lookup): what CMS, ecommerce platform, analytics and marketing tools a website runs, with evidence
- [US Business Registry Lookup](https://apify.com/scath/us-business-registry-lookup): check a company's status in official state registries, or list new LLC and corporation filings

# Actor input Schema

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

Direct links (http or https) to PDF, DOCX, PPTX, XLSX, HTML, TXT, PNG or JPG files, one per line. Only these exact links are downloaded; nothing is crawled.

## `ocr` (type: `string`):

auto = read pages that have no text layer (scans) with OCR. off = never OCR. force = OCR every PDF page even if it has text.

## `ocr_languages` (type: `string`):

Tesseract language codes joined with +, for example eng or eng+deu. Installed: eng, deu, fra, spa, ita, por, nld.

## `include_pages` (type: `boolean`):

Add a list with the text of each page (slide, or sheet) to every record.

## `extract_tables` (type: `boolean`):

Find ruled (bordered) tables in text PDFs and return them as Markdown tables. Slower on table-heavy PDFs.

## `page_markers` (type: `boolean`):

Put a  comment before each page in the Markdown text.

## `max_results` (type: `integer`):

Stop after this many documents were delivered. You are only charged for pages delivered.

## `max_file_mb` (type: `integer`):

Larger files are skipped and not charged.

## `max_pages_per_file` (type: `integer`):

Only the first N pages (slides, sheets) of each file are converted and charged.

## `timeout_seconds` (type: `integer`):

If a file takes longer, the pages finished so far are returned (or the file fails if nothing finished).

## `concurrency` (type: `integer`):

How many files are converted in parallel. Use 1 on 1 GB memory when many files need OCR.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/WAI/WCAG21/working-examples/pdf-table/table.pdf"
  ],
  "ocr": "auto",
  "ocr_languages": "eng",
  "include_pages": false,
  "extract_tables": true,
  "page_markers": false,
  "max_results": 100,
  "max_file_mb": 25,
  "max_pages_per_file": 100,
  "timeout_seconds": 180,
  "concurrency": 2
}
```

# Actor output Schema

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

No description

## `allFields` (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.w3.org/WAI/WCAG21/working-examples/pdf-table/table.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scath/documents-to-text").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.w3.org/WAI/WCAG21/working-examples/pdf-table/table.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("scath/documents-to-text").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.w3.org/WAI/WCAG21/working-examples/pdf-table/table.pdf"
  ]
}' |
apify call scath/documents-to-text --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scath/documents-to-text"
        }
    }
}
```

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/RwV2ddloWT1M7gWVo/builds/uKEpehtXHuho6j3Lx/openapi.json
