PDF Merge
Related Knowledgebase-Explore Samples
Merge PDF from two or more PDF files into a new one.
Available Methods
[POST] /pdf/merge
url
required. Comma separated urls to the source PDF files in the same order that you want them to be merged. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section. If you are randomly gettingToo Many Requests
orAccess Denied
error for your input url, please try to addcache:
to enable built-in url caching. You can also encrypt data for output files and decrypt data input files with user-controlled data encryption (uses strongAES
encryption with your own keys). Click here to learn more. Need to merge non-PDF files too? Use/pdf/merge2
endpoint instead.async
optional. Runs processing asynchronously. ReturnsJobId
that you may use with/job/check
to check state of the background job (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. name of the output file.expiration
(optional). Output link expiration in minutes. Default is60
(i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.profiles
optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.- Method: POST
- URL: /v1/pdf/merge
Query parameters
No query parameters accepted.
Body payload
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample2.pdf",
"async": false
}
Example responses
/pdf/merge
{
"url": "https://pdf-temp-files.s3.amazonaws.com/3ec287356c0b4e02b5231354f94086f2/result.pdf",
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 98465
}
Code Snippet
CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/merge' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample2.pdf",
"async": false
}'
[POST] /pdf/merge2 (supports zip, doc, rtf, xls, png, jpg etc)
This endpoint is similar to /pdf/merge
but it also supports zip, doc, docx, xls, xlsx, rtf, txt, png, jpg
files as source.
We recommended to use this endpoint in "async": true
mode because it may need to convert source documents to pdf.
This endpoint also consumes more credits because of the internal conversions.
url
required. Comma separated urls to the source files (pdf, zip, documents, txt, rtf, xls, xslx, png, jpg) in the same order that you want them to be merged. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section. If you are randomly gettingToo Many Requests
orAccess Denied
error for your input url, please try to addcache:
to enable built-in url caching. You can also encrypt data for output files and decrypt data input files with user-controlled data encryption (uses strongAES
encryption with your own keys). Click here to learn more.httpusername
(optional) - http auth user name if required to access sourceurl
.httppassword
(optional) - http auth password if required to access sourceurl
.async
optional. Runs processing asynchronously. ReturnsJobId
that you may use with/job/check
to check state of the background job (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. name of the output file.expiration
(optional). Output link expiration in minutes. Default is60
(i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.profiles
optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.- Method: POST
- URL: /v1/pdf/merge2
Query parameters
No query parameters accepted.
Body payload
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/other/Input.xls, https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/images-and-documents.zip",
"async": false
}
Example responses
/pdf/merge2
{
"url": "https://pdf-temp-files.s3.amazonaws.com/3ec287356c0b4e02b5231354f94086f2/result.pdf",
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 98465
}
Code Snippet
CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/merge2' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/other/Input.xls, https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/images-and-documents.zip",
"async": false
}'
Knowledgebase
Samples
- AWS Lambda - Merge Any Documents From URLs (Node.js)
- AWS Lambda - Merge PDF Documents From URLs (Node.js)
- C# - Async file upload and async Merge PDF
- C# - Merge Any Documents From URLs
- C# - Merge Any Documents From URLs Asynchronously
- C# - Merge PDF Documents From URLs
- C# - Merge PDF Documents From URLs Asynchronously
- C# - Merge PDF Documents From Uploaded Files
- Delphi - Merge Any Documents From URLs
- Delphi - Merge PDF Documents From URLs
- GoogleAppScript - Merge PDF Urls
- GoogleAppScript - Merge PDF Urls into Individual Row
- GoogleAppScript - Merge PDF from Google Drive and Save back
- GoogleAppScript - Merge Rows Async and Save back to Google Drive
- Java - Merge Any Documents From URLs
- Java - Merge PDF Documents From URLs
- Java - Merge PDF Documents From Uploaded Files
- JavaScript - Merge Any Documents From URLs (Node.js)
- JavaScript - Merge Any Documents From URLs (Node.js) - Async API
- JavaScript - Merge Any Documents From Uploaded File (Node.js) - Async API
- JavaScript - Merge PDF Documents (jQuery)
- JavaScript - Merge PDF Documents From URLs (Node.js)
- JavaScript - Merge PDF Documents From URLs (Node.js) - Async API
- JavaScript - Merge PDF Documents From Uploaded File (Node.js)
- JavaScript - Merge PDF Documents From Uploaded File (Node.js) - Async API
- PHP - Merge Any Documents Asynchronously
- PHP - Merge Any Documents From Uploaded Files
- PHP - Merge Any Documents From Uploaded Files Asynchronously
- PHP - Merge PDF Documents Asynchronously
- PHP - Merge PDF Documents From Uploaded Files
- PowerShell - Merge Any Documents From URLs
- PowerShell - Merge Any Documents From URLs Asynchronously
- PowerShell - Merge PDF Documents From URLs
- PowerShell - Merge PDF Documents From URLs Asynchronously
- PowerShell - Merge PDF Documents From Uploaded Files
- Python - Merge Any Documents From Uploaded Files Asynchronously
- Python - Merge PDF Documents From Uploaded Files
- Python - Merge PDF Documents From Uploaded Files Asynchronously
- Salesforce - Merge Documents From SFDC record
- Salesforce - Merge Documents From URL
- VB.NET - Async file upload and async Merge PDF
- VB.NET - Merge Any Documents From URLs
- VB.NET - Merge Any Documents From URLs Asynchronously
- VB.NET - Merge PDF Documents From URLs
- VB.NET - Merge PDF Documents From URLs Asynchronously
- VB.NET - Merge PDF Documents From Uploaded Files
- cURL - Any Document Merger
- cURL - PDF Merger
Copyright © 2016 - 2023 PDF.co