Combine PDFs
Purpose
Combine two or more PDF documents into a single PDF. You can also combine selected pages or a specific range of pages from each input document.
Quick Reference
| Property | Value |
|---|---|
| Method | POST |
| Request URL | https://{api.office-integrator_domain}/writer/officeapi/v1/documents/pdf/combine |
| Content-Type | multipart/form-data |
Parameters
Body Parameters
| Parameter | Value | Mandatory/Optional | Description |
|---|---|---|---|
| apikey | 423s***** | Mandatory | Uniquely identifies the web application which initiates the PDF combine request. |
| files | File | Mandatory | To upload the input PDF files from your local drive or desktop.
|
| output_settings | { "name": <filename> } | Optional | name -> 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" } } | Optional | page_ranges -> It is possible to combine selected pages or a specific range of pages in a document. To combine selected pages, pass the respective page numbers with comma separated (say 3,5,7,etc.). To combine a specific range of pages, pass the page ranges with a hyphen (say 1-3). |
Notes and Limits
- Up to 5 input PDF files can be combined at once.
- File size limit is up to 10 MB for each file.
- The combined PDF document response will be downloaded as bytes.
- By default, the output file name will be "output.pdf".
- For other server-side SDK sample code, refer to: Server-Side SDKs
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\"}}"'