# PDF Part Number Splitter + Excel Report (`formidable_bedpost/pdf-part-number-splitter`) Actor

Automatically split multi-page PDFs by part, order, service or reference number. Get separate, organized PDFs in one ZIP plus an Excel tracking report. Ideal for transport companies, logistics teams, dispatchers and administrative workflows. Supports text-based PDFs; scanned files require OCR.

- **URL**: https://apify.com/formidable_bedpost/pdf-part-number-splitter.md
- **Developed by:** [Rafael ochogavia](https://apify.com/formidable_bedpost) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $200.00 / 1,000 results

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 Part Number Splitter + Excel Audit

**Turn mixed multi-page PDF reports into neatly split documents by part / service / reference number.**

Upload up to 8 text-based PDFs and get a single ZIP containing separate PDFs and a beautifully formatted Excel audit workbook. Built for transport schedules, dispatch reports, work orders, service reports, logistics documents and back-office workflows.

### How it works

1. **Upload your PDFs** directly, or provide HTTPS links to downloadable PDF files.
2. Pick how to handle unlabeled pages: attach to previous part (*marked as inferred*) or send to review.
3. Run. Find `RESULT_ZIP` and `CONTROL_PARTES_XLSX` from the run's **Output** tab (or under **Storage > Key-value store**).
4. Check **Review** alerts in the Excel workbook before distributing outputs.

Each identified reference becomes one PDF. Pages belonging to the same reference are reunited even when the source report is interleaved.

### Input examples

Simple upload: use **Upload PDF files** in the input form. No coding needed.

Or submit JSON:

```json
{
  "pdfUrls": ["https://example.org/path/to/service-report.pdf"],
  "unknownPagePolicy": "inherit"
}
```

You can customize part-number matching. For example, when each page contains `ORDER ID: ABC-123456`:

```json
{
  "pdfUrls": ["https://example.org/path/to/orders.pdf"],
  "referenceRegex": "(?im)^ORDER\\s+ID\\s*:\\s*([A-Z0-9-]{3,35})"
}
```

### Outputs

- **RESULT_ZIP:** PDFs grouped by reference + Excel control workbook.
- **CONTROL_PARTES_XLSX:** Excel workbook with sheets: Summary, Parts, Pages, Instructions (labels in Spanish).
- **SUMMARY:** machine-readable JSON with counts, errors, and review flags.
- **Dataset:** one row per successfully processed input PDF with at least one identified part/reference.

### Supported formats and limitations

- Up to **8 PDFs per run**, **25 MB per PDF**, **200 pages per PDF**, **500 pages overall**.
- Digital, **text-selectable PDFs** only. Scanned PDFs without OCR layer are not supported.
- Pages with **multiple different references** are placed into a **REVIEW** PDF; never silently assigned.
- Unlabeled continuation pages may be inferred; this is **not guaranteed**, and must be manually verified.
- Two separate documents printed on the same source page cannot be split into independent pages automatically.
- User-supplied custom regex supports a first captured group or a group called `ref`.

### Privacy

Only upload files you have a right to process. Original PDFs and generated outputs are stored in your Apify-run-managed storage. Check privacy, retention, and access settings. PDF text is processed in the Actor process, without third-party AI APIs.

### Billing note

The Actor is compatible with Apify's built-in `apify-default-dataset-item` pay-per-event pricing: **one emitted dataset row per input PDF successfully processed with an identified part number**. Input files with no detected parts can still produce review files, but no chargeable dataset row. Prices are determined by the publisher, not hard-coded here.

**Version 0.1**. Test with non-sensitive examples before using on critical or confidential workflows.

# Actor input Schema

## `files` (type: `array`):

Upload PDFs (max 8 per run, 25 MB each, 200 pages each). Files are processed from the URLs provided by Apify's file upload control.

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

Optional direct links to PDFs. Combined total with uploads max 8. Only public HTTPS or accessible Apify Key-Value Store URLs.

## `unknownPagePolicy` (type: `string`):

'Attach to previous' marks continuations as inferred in Excel. 'Send to review' isolates all unlabeled pages.

## `referenceRegex` (type: `string`):

Optional regex with first capture group or named group 'ref'. Default detects 'Número de parte: 12345', 'PARTE N° 12345', 'Part number 12345'. Max 350 characters.

## Actor input object example

```json
{
  "files": [],
  "pdfUrls": [],
  "unknownPagePolicy": "inherit",
  "referenceRegex": ""
}
```

# Actor output Schema

## `zip` (type: `string`):

No description

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

No description

## `summary` (type: `string`):

No description

## `processedDocuments` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("formidable_bedpost/pdf-part-number-splitter").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("formidable_bedpost/pdf-part-number-splitter").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 '{}' |
apify call formidable_bedpost/pdf-part-number-splitter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,formidable_bedpost/pdf-part-number-splitter"
        }
    }
}
```

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/lbyE8c3M2l2TdNqFu/builds/vD074E5SIPWg9wrt6/openapi.json
