English
  1. Home
  2. Document
  3. Organize

Organize

Organize PDF document

copy
Something went wrong, try again
copy
            
                    
        
Body parameter
Parameter VALUE DESCRIPTION

organizeDocumentRequest

Required

copy
OrganizeDocumentRequest OrganizeDocumentRequest instance
OrganizeDocumentRequest
Parameter VALUE DESCRIPTION

Pages

Required

string Comma separated list of page numbers of result document. Page numbering starts from 1. Example: "2,4,1,7"

PdfBase64File

Required

close-icon
string Base64 encoded PDF document to process
copy Copy to clipboard
        
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.conholdate.cloud/v5.0/pdf/document/organize"
  method := "POST"

  payload := strings.NewReader(`{
      "Pages": "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, 
    "{" +
      "\"Pages\": \"\some value\"," +
      "\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
    "}");

Request request = new Request.Builder()
  .url("https://api.conholdate.cloud/v5.0/pdf/document/organize")
  .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/organize',
    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 =>'{
      "Pages": "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/organize"

json_data = json.dumps({
      "Pages": "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/organize' \
--header 'Content-Type: application/json' \
--data-raw '{
      "Pages": "some value",
      "PdfBase64File": "Base64 encoded file...",
}'
                   
        
            
require "uri"
require "json"
require "net/http"

url = URI("https://api.conholdate.cloud/v5.0/pdf/document/organize")

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({
      "Pages": "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/organize");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
var body = "{" + 
      "\"Pages\": \"\some value\"," +
      "\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
                       
            
Overview

About Organize Method

On this page, you will find detailed instructions on how to utilize our cloud-based API for organizing PDF files in different programming languages including Go, Java, PHP, Python, Curl, Ruby, and C#. Our API is designed to be user-friendly and easily integrated into applications, allowing developers to add PDF organizing capabilities with just a few lines of code. It offers a seamless solution for automating PDF organizing tasks, making it efficient and convenient for managing PDF files in your applications.


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.
Organize PDF
clock
Add a File
It is crucial to verify that the file you want to organize using the Document API's "Organize" method matches the one specified in the method. This ensures smooth file processing and successful execution of the organizing process. Properly aligning the input file with the method parameters is essential for achieving the desired results in your PDF file organization tasks.
arrow
clock
Run the Code
To run the code, copy and paste it into a file and execute it from the same directory where you added the necessary files. For further details, refer to our language-specific guides on how to get started.
arrow
clock
View the Result
To view the results, simply open the file that you receive as the output. This file should be located in your project folder. If you choose to use online organizing, once the organizing process is complete, the file will be automatically downloaded for your convenience.
clock
How can I organize PDF using Document API?
To organize a PDF file, simply upload it to the API page by clicking the "Choose file" button, and initiate the organizing process by clicking the "POST" button. If you wish to integrate the "Organize" method into your project, you can utilize the provided code examples in the programming language you are working with. This method allows you to change the order of pages in a PDF file, for example: "2,4,1,7". With this flexibility, you can easily reorganize the pages in your PDF file according to your specific requirements.
clock
How long does it takes to organize PDF file using Organize method (Document API)?
Document API (Organize method) is designed for efficient and speedy file splitting. With our service, you can expect fast results, often in just a matter of seconds.
clock
It is safe to organize PDF using Document API?
We understand the importance of ensuring the safety and privacy of your data. Rest assured that our company takes extensive measures to protect your information. We do not store any files you submit for organizing and process them only to provide you with the organizing results. Your security and confidentiality are our utmost priorities.
clock
What output can I expect from the organizing process?
The "Organize" method enables you to arrange the pages in a PDF file based on a selected page order, such as "2,4,1,7". This flexible approach allows you to easily reorganize the pages in your PDF file to meet your specific requirements. It's worth noting that you can duplicate pages by using the same number multiple times, for example: "2,4,2,1,1,4". This feature provides additional flexibility and control over the organization of your PDF file.
No Default Value

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.