Split a PDF

Learn how to split a large PDF into smaller, individual files.

Large PDF files can be difficult to manage and share. The Scan Documents API allows you to easily split a single PDF into multiple, smaller PDF files, making them easier to handle.

Business Problem

Imagine you work for an insurance company. You receive a single, large PDF file that contains multiple insurance claims. To process these claims efficiently, you need to split this large PDF into individual files, with each file representing a single claim.

Solution

We can solve this problem by using the split operation in the Scan Documents API. Here’s how:

Step 1: Upload the PDF

First, you need to upload the large PDF file to the Scan Documents API.

Upload a File

Creates a new file

curl -X POST "https://api.scan-documents.com/v1/files" \
  -H "x-api-key: YOUR_API_KEY" \
  -F name="All Claims" \
  -F file="@/path/to/your/claims.pdf"

The API will respond with a file object for the uploaded PDF. Take note of the file ID from the response, as you'll need it in the next step.

{
  "id": "file_euyrvozb9302uwhq",
  "name": "All Claims",
  "type": "application/pdf",
  "properties": {
    "size": 1024000,
    "page_count": 6
  },
  "task_id": null,
  "created_at": "2025-08-20T10:10:00.000Z"
}

Step 2: Split the PDF

Now that you have uploaded the PDF, you can use the split operation to divide it into smaller files. This operation will split each page of the PDF into a separate, single-page PDF file.

Split PDF

Creates a task to split a PDF file into multiple single-page PDF files.

curl -X POST "https://api.scan-documents.com/v1/pdf-operations/split" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "input": "file_euyrvozb9302uwhq" }'

The result of this task will be a new PDF file for each page of the original document.

{
  "id": "task_euyrvozb9302uwhr",
  "operation": "split",
  "status": "completed",
  "parameters": {
    "input": "file_euyrvozb9302uwhq"
  },
  "result": {
    "generated_files": [
      {
        "id": "file_euyrvozb9302uwhs",
        "name": "claims_1.pdf",
        "type": "application/pdf",
        "properties": {
          "size": 102400,
          "page_count": 1
        },
        "task_id": "task_euyrvozb9302uwhr",
        "created_at": "2025-08-20T10:15:00.000Z"
      },
      {
        "id": "file_euyrvozb9302uwht",
        "name": "claims_2.pdf",
        "type": "application/pdf",
        "properties": {
          "size": 102400,
          "page_count": 1
        },
        "task_id": "task_euyrvozb9302uwhr",
        "created_at": "2025-08-20T10:15:00.000Z"
      }
    ]
  },
  "callback_url": null,
  "created_at": "2025-08-20T10:14:00.000Z",
  "updated_at": "2025-08-20T10:15:00.000Z"
}

You can now download each individual page as a separate PDF file using the /v1/files/{id}/download endpoint. This makes it much easier to process and manage each page separately.