Split PDF API
Programmatically Divide Large PDF Files into Smaller, Manageable Documents.
Code Examples in Popular Languages
Integrate our Split PDF API easily into your apps with comprehensive code examples in popular languages to get started quickly.
curl --location 'https://theonlineconverter.com/api/v1/split-pdf' \
--header 'Content-Type: application/json' \
--header 'x-api-key: enter_your_api_key' \
--form 'file=@"/D:/data/Document/pdf/progit.pdf"' \
--form 'ranges[]="3,7,12"' \
--form 'merge="true"'
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("x-api-key", "enter_your_api_key");
const formdata = new FormData();
formdata.append("file", fileInput.files[0], "/D:/data/Document/pdf/progit.pdf");
formdata.append("ranges[]", "3,7,12");
formdata.append("merge", "true");
const requestOptions = {
method: "POST",
headers: myHeaders,
body: formdata,
redirect: "follow"
};
fetch("https://theonlineconverter.com/api/v1/split-pdf", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
import requests
import json
url = "https://theonlineconverter.com/api/v1/split-pdf"
payload = {'ranges[]': '3,7,12',
'merge': 'true'}
files=[
('file',('progit.pdf',open('/D:/data/Document/pdf/progit.pdf','rb'),'application/pdf'))
]
headers = {
'Content-Type': 'application/json',
'x-api-key': 'enter_your_api_key'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
import requests
import json
url = "https://theonlineconverter.com/api/v1/split-pdf"
payload = {'ranges[]': '3,7,12',
'merge': 'true'}
files=[
('file',('progit.pdf',open('/D:/data/Document/pdf/progit.pdf','rb'),'application/pdf'))
]
headers = {
'Content-Type': 'application/json',
'x-api-key': 'enter_your_api_key'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
<?php
$client = new Client();
$headers = [
'Content-Type' => 'application/json',
'x-api-key' => 'enter_your_api_key'
];
$options = [
'multipart' => [
[
'name' => 'file',
'contents' => Utils::tryFopen('/D:/data/Document/pdf/progit.pdf', 'r'),
'filename' => '/D:/data/Document/pdf/progit.pdf',
'headers' => [
'Content-Type' => '<Content-type header>'
]
],
[
'name' => 'ranges[]',
'contents' => '3,7,12'
],
[
'name' => 'merge',
'contents' => 'true'
]
]];
$request = new Request('POST', 'https://theonlineconverter.com/api/v1/split-pdf', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","/D:/data/Document/pdf/progit.pdf",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/D:/data/Document/pdf/progit.pdf")))
.addFormDataPart("ranges[]","3,7,12")
.addFormDataPart("merge","true")
.build();
Request request = new Request.Builder()
.url("https://theonlineconverter.com/api/v1/split-pdf")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("x-api-key", "enter_your_api_key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"net/http"
"io"
)
func main() {
url := "https://theonlineconverter.com/api/v1/split-pdf"
method := "POST"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
file, errFile1 := os.Open("/D:/data/Document/pdf/progit.pdf")
defer file.Close()
part1,
errFile1 := writer.CreateFormFile("file",filepath.Base("/D:/data/Document/pdf/progit.pdf"))
_, errFile1 = io.Copy(part1, file)
if errFile1 != nil {
fmt.Println(errFile1)
return
}
_ = writer.WriteField("ranges[]", "3,7,12")
_ = writer.WriteField("merge", "true")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-api-key", "enter_your_api_key")
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var options = new RestClientOptions("https://theonlineconverter.com")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/v1/split-pdf", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("x-api-key", "enter_your_api_key");
request.AlwaysMultipartFormData = true;
request.AddFile("file", "/D:/data/Document/pdf/progit.pdf");
request.AddParameter("ranges[]", "3,7,12");
request.AddParameter("merge", "true");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Key Features & Capabilities
Our Split PDF API is designed with flexible and powerful features to handle any document separation task.
Multiple Split Modes
Choose how to divide your PDF: split every page into a separate file, define custom page ranges, or split into fixed chunks (e.g., every 2 pages).
Extract Specific Pages
Easily extract a single page or a precise set of non-consecutive pages from a large document into a new PDF.
High-Fidelity Output
The splitting process is lossless, ensuring that the quality, formatting, annotations, and orientation of the original pages are perfectly preserved.
Structured File Output
Receive your newly created PDF files in a convenient format, such as a single ZIP archive containing all the documents, or a JSON response with links to each file.
Fast & Scalable Performance
Engineered for speed, our API processes split jobs in seconds and is built to scale, handling large files and high-volume requests reliably.
Secure & Confidential
All files are processed over encrypted connections. We guarantee document confidentiality with a strict data privacy policy and do not store your files.
Frequently Asked Questions
Find answers to common questions about our Split PDF API to help you integrate and use the service effectively.

























