# PDF to Excel Converter - PDF to Word, XLSX, CSV Tables (`jayraj0975/pdf-to-word-excel`) Actor

Extract page text and convert public or stored PDFs to page-matched Word files and table workbooks, with per-page accuracy signals.

- **URL**: https://apify.com/jayraj0975/pdf-to-word-excel.md
- **Developed by:** [Jay Gaikwad](https://apify.com/jayraj0975) (community)
- **Categories:** Developer tools, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 75.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 pdf page processeds

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 Word, Excel & Text

Turn text-layer PDFs into usable page text, page-matched Word documents, and Excel workbooks with an accuracy report you can inspect. Give the actor public PDF URLs, PDF files already stored in the run's default key-value store, or both.

No OCR is performed. A page without an extractable text layer is marked `NEEDS_OCR` instead of inventing text.

### What you get

Each PDF produces one dataset row containing:

- the full PDF page count and the number of pages actually processed;
- extracted text for every processed page;
- characters, words, output characters, output words, and similarity for every page;
- one-based page numbers that need OCR;
- a `.docx` download URL when Word output is requested;
- an `.xlsx` download URL when Excel output is requested; and
- a clear per-file error without stopping the remaining files.

The Word output has one explicit Word page per processed PDF page. A scanned page receives a visible `NEEDS_OCR` placeholder. The Excel output uses detected tables when available and falls back to positioned text rows when no table boundary is detected.

### Input

| Field | Required | Default | Description |
|---|---:|---:|---|
| `pdfUrls` | one source list is required | `[]` | Up to 20 public `http` or `https` PDF URLs. |
| `fileKeys` | one source list is required | `[]` | Binary PDF record keys in the run's default key-value store. |
| `mode` | no | `all` | `text`, `docx`, `xlsx_tables`, or `all`. |
| `maxPages` | no | `100` | Maximum pages processed per PDF, from 1 to 1,000. |

The combined limit is 20 PDFs per run. Each file is limited to 25 MiB. URL requests allow only standard HTTP/HTTPS ports, validate every redirect, reject non-PDF content types, pin connections to validated public IP addresses, and block private, loopback, link-local, reserved, and other non-public address ranges.

```json
{
  "pdfUrls": [
    "https://example.com/invoice.pdf",
    "https://example.com/report.pdf"
  ],
  "fileKeys": ["INPUT.pdf"],
  "mode": "all",
  "maxPages": 100
}
```

### Sample output

```json
{
  "sourceType": "url",
  "source": "https://example.com/report.pdf",
  "finalUrl": "https://example.com/report.pdf",
  "fileKey": null,
  "filename": "report.pdf",
  "mode": "all",
  "pageCount": 2,
  "processedPageCount": 2,
  "pagesNeedingOcr": [2],
  "pages": [
    {
      "page": 1,
      "status": "TEXT",
      "text": "Quarterly report...",
      "characters": 1842,
      "words": 296,
      "outputCharacters": 1842,
      "outputWords": 296,
      "similarity": 1.0,
      "doubtfulHyphenations": "",
      "differences": ""
    },
    {
      "page": 2,
      "status": "NEEDS_OCR",
      "text": "",
      "characters": 0,
      "words": 0,
      "outputCharacters": 18,
      "outputWords": 4,
      "similarity": 0.0,
      "doubtfulHyphenations": "",
      "differences": "insert: PDF='' | output='NEEDS_OCR - PAGE 2'"
    }
  ],
  "docxUrl": "https://api.apify.com/v2/key-value-stores/.../records/outputs%2F001-abc.docx",
  "xlsxUrl": "https://api.apify.com/v2/key-value-stores/.../records/outputs%2F001-abc.xlsx",
  "error": null
}
```

The values above demonstrate the response shape; actual counts and links come from your run.

### Pricing

The intended pay-per-event pricing is **$0.005 per run start plus $0.002 per successfully processed page**. A rejected or failed file has no page event. `maxPages` gives you a direct processing cap, and an Apify run spending limit is respected. Store billing still must be selected and confirmed manually before publication; this repository does not activate it.

### Honest limits

- This version does not run OCR. Image-only pages are reported as `NEEDS_OCR`.
- It reconstructs editable text and basic heading emphasis; it does not promise pixel-identical Word layout.
- Borderless, nested, rotated, or visually complex tables may fall back to text rows or need cleanup.
- Password-protected, corrupt, zero-page, non-PDF, oversized, and inaccessible inputs return an error.
- `maxPages` processes pages from the beginning of the file; it does not select arbitrary ranges.
- Download URL access and retention follow the permissions and retention settings of your Apify key-value store.

Use only PDFs you are allowed to process, and review generated files before relying on them for consequential decisions.

# Actor input Schema

## `pdfUrls` (type: `array`):

Public http or https PDF URLs. Redirects and resolved addresses are checked to block private and internal networks.

## `fileKeys` (type: `array`):

Keys of binary PDF records in this run's default key-value store, such as INPUT.pdf.

## `mode` (type: `string`):

Return page text only, a Word file, an Excel table workbook, or all available outputs.

## `maxPages` (type: `integer`):

Process at most this many pages from the start of each PDF. The result still reports the PDF's full page count.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "fileKeys": [],
  "mode": "all",
  "maxPages": 5
}
```

# Actor output Schema

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

One result row per requested PDF, including page text, accuracy fields, OCR flags, errors, and artifact download URLs.

## `files` (type: `string`):

Word and Excel artifacts stored in the run's default key-value store.

# 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 = {
    "pdfUrls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ],
    "mode": "all",
    "maxPages": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("jayraj0975/pdf-to-word-excel").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 = {
    "pdfUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"],
    "mode": "all",
    "maxPages": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("jayraj0975/pdf-to-word-excel").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 '{
  "pdfUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "mode": "all",
  "maxPages": 5
}' |
apify call jayraj0975/pdf-to-word-excel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jayraj0975/pdf-to-word-excel"
        }
    }
}
```

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/NxNiNpuIDrIsTOz1L/builds/wt3IfeJyaqdza1Qna/openapi.json
