# Extract tables from PDF to Excel and CSV

**Use case:** 

Get every table of a PDF as rows and columns, with or without borders, including multi-row headers. This example reads a W3C sample table. One row per page opens well in Excel or CSV (each table is in the markdown column); JSON has every table as rows and columns. Tables are included at no extra cost.

## Input

```json
{
  "urls": [
    "https://www.w3.org/WAI/WCAG21/working-examples/pdf-table/table.pdf"
  ],
  "output_format": "pages",
  "include_markdown": true,
  "include_pages": false,
  "extract_tables": true,
  "chunk_size": 1000,
  "chunk_overlap": 150,
  "ocr_scanned_pages": false,
  "ocr_languages": [
    "eng"
  ],
  "ocr_max_pages_per_pdf": 2000,
  "export_images": false,
  "images_min_size_px": 64,
  "images_skip_duplicates": true,
  "images_format": "original",
  "images_max_per_pdf": 500,
  "page_images": false,
  "page_images_dpi": 150,
  "page_images_format": "png",
  "page_images_quality": 90,
  "page_images_thumbnail": false,
  "page_images_max_per_pdf": 2000,
  "remove_headers_footers": false,
  "remove_page_numbers": false,
  "remove_blank_lines": false,
  "skip_empty_pages": false,
  "max_pages_per_pdf": 2000,
  "max_pdf_size_mb": 100,
  "timeout_per_pdf_secs": 1800,
  "max_concurrency": 3
}
```

## Output

```json
{
  "source": {
    "label": "Source",
    "format": "text"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "page_count": {
    "label": "Pages",
    "format": "number"
  },
  "extracted_page_count": {
    "label": "Pages extracted",
    "format": "number"
  },
  "ocr_page_count": {
    "label": "OCR pages",
    "format": "number"
  },
  "title": {
    "label": "Title",
    "format": "text"
  },
  "author": {
    "label": "Author",
    "format": "text"
  },
  "char_count": {
    "label": "Characters",
    "format": "number"
  },
  "word_count": {
    "label": "Words",
    "format": "number"
  },
  "text": {
    "label": "Text",
    "format": "text"
  },
  "markdown": {
    "label": "Markdown",
    "format": "text"
  },
  "page": {
    "label": "Page",
    "format": "number"
  },
  "chunk_index": {
    "label": "Chunk",
    "format": "number"
  },
  "page_start": {
    "label": "From page",
    "format": "number"
  },
  "page_end": {
    "label": "To page",
    "format": "number"
  },
  "subject": {
    "label": "Subject",
    "format": "text"
  },
  "creator": {
    "label": "Creator",
    "format": "text"
  },
  "producer": {
    "label": "Producer",
    "format": "text"
  },
  "created_at": {
    "label": "Created at",
    "format": "text"
  },
  "modified_at": {
    "label": "Modified at",
    "format": "text"
  },
  "is_encrypted": {
    "label": "Protected",
    "format": "boolean"
  },
  "file_size_mb": {
    "label": "Size (MB)",
    "format": "number"
  },
  "source_type": {
    "label": "Source type",
    "format": "text"
  },
  "file_type": {
    "label": "File type",
    "format": "text"
  },
  "error_code": {
    "label": "Error code",
    "format": "text"
  },
  "error": {
    "label": "Note or error",
    "format": "text"
  },
  "processed_at": {
    "label": "Processed at",
    "format": "date"
  }
}
```

## How it works

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

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

### 2. Start the "Extract tables from PDF to Excel and CSV" task

The PDF Extractor All-in-One: Text, Tables & OCR Actor will start running based on the input automatically. You can also change all the input fields, like 📄 pdf urls, 🧾 output format, and more, to match your specific use case.

### 3. Receive the "Extract tables from PDF to Excel and CSV" 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 source, status, 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 "Extract tables from PDF to Excel and CSV" task via API](https://apify.com/t800solutions/pdf-extractor.md).

## FAQ

### Where are the tables in Excel?

In the markdown column of each page row, as Markdown tables. Export JSON to get the tables field with every table as rows and columns.

### Do tables cost extra?

No. Tables are included in the page price ($1.00 per 1,000 pages on the Free plan).

## About this Actor

This example demonstrates how to use [PDF Extractor All-in-One: Text, Tables & OCR](https://apify.com/t800solutions/pdf-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/t800solutions/pdf-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/t800solutions/pdf-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`).
