# PDF to Excel, Markdown & Text: Extract Tables from PDFs in Bulk (`blueberry_rainstorm/pdf-to-text-markdown`) Actor

Extract tables from PDFs to Excel/CSV and convert PDF to Markdown or text, in bulk. Ruled and borderless tables (bank statements, reports), multi-page tables joined, real numbers, OCR in 12 languages. $3 per 1,000 PDFs.

- **URL**: https://apify.com/blueberry_rainstorm/pdf-to-text-markdown.md
- **Developed by:** [Pandapi](https://apify.com/blueberry_rainstorm) (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 to Excel, Markdown & Text: Extract Tables from PDFs in Bulk

Turn any number of PDFs into **clean text, LLM-ready Markdown and real spreadsheets**. Tables come out as **Excel (.xlsx) or CSV**, including **borderless tables** like bank statements and financial reports, with numbers you can sum and tables that run over several pages joined into one. Scanned pages are read with OCR. Works with PDF links, uploads or base64 through the API.

**Price example:** 500 bank statements to one Excel workbook costs **$1.50**. Failed PDFs are free and there is no start fee.

### What you get

- **Excel workbook per PDF** (one sheet per table plus an index sheet), and **`tables.xlsx` with every table from the run**, so a batch of 200 statements lands in one file.
- **CSV per table** if you prefer (UTF-8 with BOM, opens cleanly in Excel and Google Sheets).
- **Markdown and plain text** with headings, lists and tables kept, repeated headers, footers and page numbers removed.
- **JSON** with each table's page, title, header and rows, plus metadata, per-page text, links and RAG chunks.

### Why this one

| | This Actor | Online converters (Smallpdf, iLovePDF, Acrobat) | PDFTables / Azure / Textract | Other Apify PDF actors |
|---|---|---|---|---|
| Price | **$3 per 1,000 PDFs** | Subscription, daily limits on free plans | ~$10-50 per 1,000 pages | ~$5 per 1,000 PDFs + start fees |
| Borderless tables (statements, reports) | ✅ | Often messy | ✅ | ❌ (text or Markdown only) |
| Excel with real numbers (`$1,250` → 1250, `(300)` → -300, `12.5%` → 0.125) | ✅ | Varies | Varies | ❌ |
| Tables continuing over pages joined, repeated header removed | ✅ | ❌ | Varies | ❌ |
| Wrapped description lines kept in one row | ✅ | Varies | Varies | ❌ |
| Merged header cells kept in Excel, joined in CSV ("Percent Fuel Savings Improved Speed") | ✅ | Partial | Partial | ❌ |
| One workbook for a whole batch of PDFs | ✅ | ❌ | ❌ | ❌ |
| Bulk + API + schedules + integrations (Make, n8n, Zapier) | ✅ | ❌ | API only | ✅ |
| OCR for scanned pages, 12 languages | ✅ $5 per 1,000 pages | Paid plans | ✅ | Often $15 per 1,000 pages |
| Failed PDFs charged | **Never** | n/a | Yes | Varies |

### Output example

```json
{
  "fileName": "statement-2026-08.pdf",
  "status": "ok",
  "pageCount": 2,
  "tableCount": 1,
  "excelUrl": "https://api.apify.com/v2/key-value-stores/.../records/statement-2026-08.xlsx",
  "tables": [{
    "index": 1, "page": 1, "pageEnd": 2, "method": "ruled", "title": null,
    "header": ["Date", "Description", "Debit", "Credit", "Balance"],
    "headerRows": 1, "rowCount": 47, "columnCount": 5,
    "rows": [["Date", "Description", "Debit", "Credit", "Balance"],
             ["08/02/2026", "UTILITY ELECTRIC CO", "124.82", "", "4,085.73"]]
  }],
  "markdown": "...",
  "text": "..."
}
```

`rows` includes the header rows first (`headerRows` tells you how many); `header` is one flat header line. `method` is `ruled` (table drawn with lines) or `aligned` (borderless, found from aligned columns).

The run's **Output** tab links **All tables (Excel)**. Every file is also in the run's key-value store (Storage tab).

PDFs that fail (404, not a PDF, wrong password, too large) come back with `"status": "failed"` and a clear `error`, and are **not charged**.

### Pricing

- **$3 per 1,000 PDFs** extracted ($0.003 each), tables and spreadsheets included
- **$5 per 1,000 OCR pages** ($0.005 per scanned page), only for pages that need OCR

Set "Maximum cost per run" in Apify to cap spending.

### Tips

- **Bank statements and reports:** keep "Ruled and borderless tables" on. Use **All tables stacked on one sheet** to get one long sheet for a whole batch.
- **Only tables drawn with lines:** switch to that mode if a document has lots of aligned numbers that are not tables (e.g. forms).
- Use **Pages** to process only the parts you need, e.g. `3-5` or `-2` for the last two pages.
- Scanned PDFs: their text is read with OCR; table detection works on PDFs with a text layer.

### FAQ

**How do I extract tables from many PDFs into one Excel file?** Add all the PDF links (or upload them), keep the default table mode, and download `tables.xlsx` from the run's key-value store: every table from every PDF, one sheet each, plus an index sheet. Choose **All tables stacked on one sheet** for one long sheet.

**Does it handle borderless tables like bank statements?** Yes. Keep "Ruled and borderless tables" on. Rows that wrap onto two lines stay one row, and numbers like `$1,250.00` or `(300)` become real numbers.

**Can it convert PDF to Markdown for RAG or an LLM?** Yes. Every PDF also comes back as Markdown (headings, lists and tables kept) and plain text, with optional RAG chunks.

**What about scanned PDFs?** Pages without a text layer are read with OCR in 12 languages and charged $0.005 per page. Pages that already have text are never charged for OCR.

**How do I call it from Python or n8n?** Use the Apify API or client with a list of PDF links in `urls` and read the dataset; the Excel files are in the run's key-value store. It also works in Make, n8n, Zapier and the Apify MCP server.

### Responsible use

Only process documents you have the right to use. Files you send are processed in your own Apify run and stored in your own Apify storage.

### More from Pandapi 🐼

Pandapi makes friendly, no-nonsense data tools: simple input, clean output, and fair pay-per-result prices. Found a bug or need a feature? Open an issue on the Issues tab and we answer fast.

- [Web Page to Markdown](https://apify.com/blueberry_rainstorm/web-page-to-markdown): clean, chunked Markdown from any URL or sitemap, ready for AI and RAG
- [Website Contact Details Scraper](https://apify.com/blueberry_rainstorm/website-contact-finder): business emails, phones and social links, one row per website
- [Website Screenshot](https://apify.com/blueberry_rainstorm/website-screenshot): full-page and mobile screenshots or PDFs of many URLs at once
- [Broken Link Checker](https://apify.com/blueberry_rainstorm/broken-link-checker): every 404, dead link and redirect on a site, with the page it is on
- [Public Tenders Feed](https://apify.com/blueberry_rainstorm/public-tenders-feed): government tenders and contract awards from six official portals
- [App Store Reviews Scraper](https://apify.com/blueberry_rainstorm/app-store-reviews-scraper): iOS reviews, ratings and app details from about 180 countries
- [Google Play Reviews Scraper](https://apify.com/blueberry_rainstorm/google-play-reviews-scraper): Android reviews with developer replies, ratings and app data, many languages
- [HTML to PDF](https://apify.com/blueberry_rainstorm/html-to-pdf): web pages, HTML or a template plus JSON rows (invoices, certificates) to PDF
- [Hacker News Scraper](https://apify.com/blueberry_rainstorm/hacker-news-scraper): stories, comments, Show HN and job posts, filtered your way

# Actor input Schema

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

Links to PDF files. Add as many as you like.

## `pdfFile` (type: `string`):

Upload a PDF from your computer.

## `base64Pdfs` (type: `array`):

List of base64 strings, or objects like {"name": "invoice.pdf", "data": "<base64>"}.

## `password` (type: `string`):

For password-protected PDFs.

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

e.g. 1-5, 8, 10- or -3 for the last three pages. Empty = all pages.

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

Safety limit for very long documents.

## `includeMarkdown` (type: `boolean`):

LLM/RAG-ready Markdown.

## `includeText` (type: `boolean`):

Full plain text.

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

Text of each page separately, with page numbers (for citations).

## `tableDetection` (type: `string`):

Borderless detection reads tables from aligned columns of text and numbers, as in bank statements and financial reports.

## `spreadsheetOutput` (type: `string`):

Excel: one workbook per PDF plus tables.xlsx with every table from the run. Links are in each result (excelUrl, csvFiles) and in the run's Storage tab.

## `spreadsheetLayout` (type: `string`):

How tables are laid out in the Excel files.

## `mergeMultiPageTables` (type: `boolean`):

A table split over several pages (same columns) becomes one table, with the repeated header removed.

## `numbersAsNumbers` (type: `boolean`):

"$1,250.00", "(300)" and "12.5%" become numbers you can sum, keeping their currency, negative and percent format. Codes with leading zeros stay text.

## `includeTables` (type: `boolean`):

Add a 'tables' field with each table's header, rows, page and title.

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

List the web links embedded in the PDF.

## `removeHeadersFooters` (type: `boolean`):

Cleaner text for reading and AI.

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

Read text from scanned pages and images. OCR pages are charged separately.

## `ocrLanguages` (type: `array`):

Languages present in your scanned documents.

## `maxOcrPagesPerPdf` (type: `integer`):

Caps OCR cost on big scanned files.

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

Also split into chunks split on headings, each with its heading path.

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

Overlap between chunks of a long section.

## `maxPdfSizeMb` (type: `integer`):

Bigger files are skipped (free).

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

How many PDFs to process at once.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://arxiv.org/pdf/1706.03762"
    },
    {
      "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    }
  ],
  "maxPagesPerPdf": 1000,
  "includeMarkdown": true,
  "includeText": true,
  "includePages": false,
  "tableDetection": "all",
  "spreadsheetOutput": "xlsx",
  "spreadsheetLayout": "sheetPerTable",
  "mergeMultiPageTables": true,
  "numbersAsNumbers": true,
  "includeTables": true,
  "includeLinks": false,
  "removeHeadersFooters": true,
  "ocr": "auto",
  "ocrLanguages": [
    "eng"
  ],
  "maxOcrPagesPerPdf": 50,
  "chunkSize": 0,
  "chunkOverlap": 100,
  "maxPdfSizeMb": 100,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `excel` (type: `string`):

No description

## `results` (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": [
        {
            "url": "https://arxiv.org/pdf/1706.03762"
        },
        {
            "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("blueberry_rainstorm/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 = { "urls": [
        { "url": "https://arxiv.org/pdf/1706.03762" },
        { "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" },
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,blueberry_rainstorm/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/hilXGFJTHybZDmDnd/builds/AozKAUhzSpmaNfWXO/openapi.json
