# PDF Toolkit - Merge, Split, Compress, Rotate & Watermark PDFs (`wood-between-studio/pdf-toolkit`) Actor

All-in-one PDF tool: merge many PDFs, split by page or range, extract pages, rotate, add a text watermark, compress with Ghostscript, or read page count and metadata. Works with PDF links, returns download links. $2 per 1,000 output files.

- **URL**: https://apify.com/wood-between-studio/pdf-toolkit.md
- **Developed by:** [Wood Between Studio](https://apify.com/wood-between-studio) (community)
- **Categories:** Developer tools, Automation, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 pdf file createds

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 Toolkit: Merge, Split, Extract, Rotate, Watermark and Compress PDFs

**One Actor for everyday PDF jobs, in bulk, from links.** Merge many PDFs into one, split into single pages or ranges, extract pages, rotate, stamp a text watermark, **compress with Ghostscript**, or read page count and metadata. Every output file gets a download link.

### Why use it?

- **Seven operations, one tool:** `merge`, `split`, `extract`, `rotate`, `watermark`, `compress`, `info`.
- **Flexible page selection:** `1-3,5,8-last`, `odd`, `even`. For split, each comma part becomes one file, or split every N pages.
- **Real compression:** Ghostscript presets (screen 72 dpi, ebook 150 dpi, printer 300 dpi, prepress). If a file is already optimal you get the original back, never a bigger file.
- **Automation-ready:** call it from Make, Zapier, n8n or the API; files land in the run's key-value store.
- **Cheap and fair.** **$2 per 1,000 output files** ($0.50 per 1,000 for Info). No start fee. Failed inputs are free.

### Use cases

- Combine invoices, reports or scanned pages into one PDF
- Split long reports or books into chapters or single pages
- Stamp DRAFT / CONFIDENTIAL / your brand on documents before sharing
- Shrink PDFs for email or web upload
- Audit a folder of PDFs: page counts, sizes, titles, producers

### Input

| Field | Default | Notes |
|---|---|---|
| `operation` | `merge` | see above |
| `pdfUrls` | (required) | Direct PDF links (merge keeps this order) |
| `pages` | all | `1-3,5,8-last`, `odd`, `even` |
| `splitEvery` | `1` | split without `pages` |
| `rotateDegrees` | `90` | `90`, `180`, `270` |
| `watermarkText` / `watermarkPosition` / `watermarkOpacity` / `watermarkSize` | `CONFIDENTIAL` / `diagonal` / `0.15` / auto | |
| `compressionLevel` | `ebook` | `screen`, `printer`, `prepress` |
| `outputName` | `merged` | merge file name |
| `title` | | sets PDF title metadata |

```json
{ "operation": "merge", "pdfUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "https://pdfobject.com/pdf/sample.pdf"] }
```

```json
{ "operation": "compress", "pdfUrls": ["https://example.org/big-report.pdf"], "compressionLevel": "ebook" }
```

### Output (one row per output file)

```json
{ "operation": "merge", "status": "success", "fileName": "merged.pdf", "downloadUrl": "https://api.apify.com/v2/key-value-stores/.../records/merged.pdf", "sizeBytes": 28223, "pages": 2,
  "sources": [{ "url": "https://www.w3.org/.../dummy.pdf", "pages": 1 }, { "url": "https://pdfobject.com/pdf/sample.pdf", "pages": 1 }] }
```

Compress rows also include `originalBytes` and `savedPercent`. Info rows include `pages`, `pdfVersion`, `title`, `author`, `producer`, dates, `pageSizes` and `hasForm`.

### Pricing

Pay per event: **$0.002 per output PDF** and **$0.0005 per PDF analyzed** in Info mode. No start fee.

### Notes

Password-protected PDFs are reported as failed (free). Max 200 MB per file. Only process documents you have the right to modify. Built by Wood Between Studio. Questions? Open an issue on the Issues tab.

# Actor input Schema

## `operation` (type: `string`):

What to do with the PDFs.

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

Direct links to PDF files (merge keeps this order).

## `pages` (type: `string`):

Optional page selection, e.g. 1-3,5,8-last, odd, even. For split, each comma part becomes one file.

## `splitEvery` (type: `integer`):

For split without a page selection.

## `rotateDegrees` (type: `string`):

For rotate.

## `watermarkText` (type: `string`):

For watermark.

## `watermarkPosition` (type: `string`):

For watermark.

## `watermarkOpacity` (type: `string`):

0.02 to 1.

## `watermarkSize` (type: `integer`):

Optional (auto-sized by default).

## `compressionLevel` (type: `string`):

For compress.

## `outputName` (type: `string`):

For merge.

## `title` (type: `string`):

Optional PDF title metadata for output files.

## `skipBadFiles` (type: `boolean`):

For merge: continue without unreadable files.

## Actor input object example

```json
{
  "operation": "merge",
  "pdfUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "https://pdfobject.com/pdf/sample.pdf"
  ],
  "splitEvery": 1,
  "rotateDegrees": "90",
  "watermarkText": "CONFIDENTIAL",
  "watermarkPosition": "diagonal",
  "watermarkOpacity": "0.15",
  "compressionLevel": "ebook",
  "outputName": "merged",
  "skipBadFiles": true
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "pdfUrls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "https://pdfobject.com/pdf/sample.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("wood-between-studio/pdf-toolkit").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",
        "https://pdfobject.com/pdf/sample.pdf",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("wood-between-studio/pdf-toolkit").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",
    "https://pdfobject.com/pdf/sample.pdf"
  ]
}' |
apify call wood-between-studio/pdf-toolkit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wood-between-studio/pdf-toolkit"
        }
    }
}
```

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/CyD5ueCfWHi5kfgNh/builds/3eJNm92a2cbOyuQOg/openapi.json
