Split PDF
Split a PDF document into multiple files based on page ranges or individual pages.
https://api.morphopdf.com/v1/pdf/splitAuthentication
Retrieve your API Key from Dashboard.
Request Body
One input source is required (file, fileBase64, or url).
fileFileThe PDF file to split, uploaded via multipart/form-data.
fileBase64stringBase64-encoded PDF content as an alternative to file upload.
urlstringPublic URL of PDF file to fetch and split.
Split Options
splitModestringThe split mode: 'ranges' to split by page ranges, or 'individual' to extract specific pages.
rangesstring[]OptionalArray of page ranges when using splitMode='ranges'. Example: ['1-5', '6-10', '11-15'].
pageNumbersnumber[]OptionalArray 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: jsonResponse 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):
successbooleanIndicates whether the operation completed successfully.
messagestringHuman-readable status message.
zipDownloadUrlstringPresigned URL to download a ZIP file containing all split PDFs. Valid for 1 hour.
filesarrayArray of split PDF file objects.
Binary Response (ZIP)
Add ?format=binary to receive a ZIP file containing all split PDF files directly.
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_PDF | Invalid or missing PDF file |
| 400 | INVALID_SPLIT_MODE | splitMode must be 'ranges' or 'individual' |
| 400 | INVALID_RANGES | Invalid page range format |
| 500 | SPLIT_FAILED | Internal processing error |
/v1/pdf/splitcurl -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{
"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&..."
}
]
}