Split PDF

Split a PDF document into multiple files based on page ranges or individual pages.

POSThttps://api.morphopdf.com/v1/pdf/split

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

One input source is required (file, fileBase64, or url).

fileFile

The PDF file to split, uploaded via multipart/form-data.

fileBase64string

Base64-encoded PDF content as an alternative to file upload.

urlstring

Public URL of PDF file to fetch and split.

Split Options

splitModestring

The split mode: 'ranges' to split by page ranges, or 'individual' to extract specific pages.

rangesstring[]Optional

Array of page ranges when using splitMode='ranges'. Example: ['1-5', '6-10', '11-15'].

pageNumbersnumber[]Optional

Array of specific page numbers when using splitMode='individual'. Example: [1, 3, 5, 7].

Array Format

For multipart form data, pass arrays as JSON strings (e.g., '["1-5", "6-10"]'). For JSON request body, pass them as native arrays.

Query Parameters

formatstringOptionalDefault: json

Response format. Use 'binary' to receive a ZIP file containing all split PDFs directly, or 'json' (default) to receive metadata with download URLs.

Response

When using format=json (default):

successboolean

Indicates whether the operation completed successfully.

messagestring

Human-readable status message.

zipDownloadUrlstring

Presigned URL to download a ZIP file containing all split PDFs. Valid for 1 hour.

filesarray

Array of split PDF file objects.

Binary Response (ZIP)

Add ?format=binary to receive a ZIP file containing all split PDF files directly.

Error Responses

StatusCodeDescription
400INVALID_PDFInvalid or missing PDF file
400INVALID_SPLIT_MODEsplitMode must be 'ranges' or 'individual'
400INVALID_RANGESInvalid page range format
500SPLIT_FAILEDInternal processing error
POST/v1/pdf/split
curl -X POST "https://api.morphopdf.com/v1/pdf/split?format=binary" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.pdf" \
  -F "splitMode=ranges" \
  -F 'ranges=["1-2", "3-5"]' \
  --output split_files.zip
200OK
{
  "success": true,
  "message": "PDF split successfully",
  "zipDownloadUrl": "https://files.morphopdf.com/sessions/abc123/output/split-pages.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&...",
  "files": [
    {
      "fileName": "page-1.pdf",
      "pages": "1",
      "downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/page-1.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&..."
    },
    {
      "fileName": "page-2.pdf",
      "pages": "2",
      "downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/page-2.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&..."
    }
  ]
}