Combine PDFs

Purpose

Using this API, you will be able to combine two PDF documents.

HTTP Request URL

https://{api.office-integrator_domain}/writer/officeapi/v1/documents/pdf/combine

Body Parameters

ParameterData TypeDescription
Mandatory Parameters
apikey423s*****Uniquely identifies the web application which initiates the document combine request.
files
 
File
 

To upload the input files from your local drive or desktop.

Note:

  • Upto 5 input pdf files can be combined at once.
  • File size limit will be upto 10 MB for each file.
Optional Parameters
output_settings

{
name: <filename>
}

Specify a unique name for the merged or combined output file .

By default, the output file name will be "output.pdf".
input_options

{
   1: {   
             page_ranges  : "3,5,7" ,    
        },
    2 :  {
           page_ranges : "1-3, 5"
       }
}

It is possible to combine selected pages or a specific range pages in a document.

To combine selectedpages, you will have to pass the respective page numbers with comma separated (say 3,5,7,etc.,).

To combine a specific range of pages, you will have to pass the page ranges with a hypen (say 1-3).

Sample Request

Copiedcurl --location --request POST "https://api.office-integrator.com/writer/officeapi/v1/documents/pdf/combine?apikey=423s*****" \
  --header "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" \
  --form 'output_settings="{\"name\":\"CombinedFile.pdf\"}"' \ 
  --form 'files=@"/Users/username/Documents/Sample1.pdf"' \ 
  --form 'files=@"/Users/username/Documents/Sample2.pdf"' \ 
  --form 'input_options="{\"1\":{\"page_ranges\":\"3,5,6\"},\"2\":{\"page_ranges\":\"1-3,6\"}}"' 

Sample Response

The combined PDF document will be downloaded as bytes.