Split
Splits PDF document by pages or ranges
Parameter | VALUE | DESCRIPTION |
---|---|---|
splitDocumentRequest Required |
|
SplitDocumentRequest
SplitDocumentRequest instance
|
Parameter | VALUE | DESCRIPTION |
---|---|---|
PdfBase64File Required |
|
string
Base64 encoded PDF document to process
|
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.conholdate.cloud/v5.0/pdf/document/split"
method := "POST"
payload := strings.NewReader(`{
"EachPage": true,
"Ranges": "some value",
"PdfBase64File": "Base64 encoded file...",
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
File file = new File("path/to/file/fileName.pdf");
byte[] encoded = Base64.encodeBase64(FileUtils.readFileToByteArray(file));
String base64EncodedFile = new String(encoded, StandardCharsets.US_ASCII);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType,
"{" +
"\"EachPage\": true," +
"\"Ranges\": \"\some value\"," +
"\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
"}");
Request request = new Request.Builder()
.url("https://api.conholdate.cloud/v5.0/pdf/document/split")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.conholdate.cloud/v5.0/pdf/document/split',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"EachPage": true,
"Ranges": "some value",
"PdfBase64File": "Base64 encoded file...",
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://api.conholdate.cloud/v5.0/pdf/document/split"
json_data = json.dumps({
"EachPage": true,
"Ranges": "some value",
"PdfBase64File": "Base64 encoded file...",
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=json_data)
print(response.text)
curl --location --request POST 'https://api.conholdate.cloud/v5.0/pdf/document/split' \
--header 'Content-Type: application/json' \
--data-raw '{
"EachPage": true,
"Ranges": "some value",
"PdfBase64File": "Base64 encoded file...",
}'
require "uri"
require "json"
require "net/http"
url = URI("https://api.conholdate.cloud/v5.0/pdf/document/split")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"EachPage": true,
"Ranges": "some value",
"PdfBase64File": "Base64 encoded file...",
})
response = https.request(request)
puts response.read_body
var client = new RestClient("https://api.conholdate.cloud/v5.0/pdf/document/split");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
var body = "{" +
"\"EachPage\": true," +
"\"Ranges\": \"\some value\"," +
"\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
About Split Method
This page provides comprehensive instructions on how to use our cloud-based API for splitting PDF files in various programming languages, such as Go, Java, PHP, Python, Curl, Ruby, and C#. Designed to be user-friendly and easily integrated into applications, our API enables developers to quickly add PDF splitting capabilities with just a few lines of code, making it a seamless solution for automating PDF split tasks.
Programming languages the API is compatible with
The API uses the REST protocol, making it compatible with a wide range of programming languages, including but not limited to: Go, Java, PHP, Python, Curl, Ruby, C#.Easy to use
Our API Reference and Guide is designed to be straightforward and easy to use, providing all the information you need to get started quickly. Additionally, our API Libraries come with their own set of documentation, making integration into your application a breeze. With our comprehensive resources, you can efficiently leverage our API to meet your needs.Secure
At our company, we place a high priority on your security and privacy. To protect your private data, we never store it in our environment and offer isolated options. We understand the importance of keeping your information safe and take all necessary measures to ensure that it remains secure.Frequently Asked Questions
We encourage you to review our Frequently Asked Questions (FAQ) section for answers to common inquiries. If you do not find the information you need, our dedicated support service is readily available to assist you with any additional questions or concerns. Don't hesitate to reach out for further assistance.