Merge PDF FIles with PDF.co

The PDF.co PDF Merger API can merge a mix of different document formats into a single PDF. This will allow you to merge an image, a doc, a spreadsheet, and a PDF into a single PDF file. This API function can save you time and effort by taking away the hassle of converting the non-PDF to PDF before they can be merged.

Following are the supported document formats in PDF Merger:

  • ZIP
  • XLS / XLSX
  • TXT
  • DOC / DOCX
  • JPG / PNG
  • RTF

SIGN UP FOR FREE

There are two PDF Merger API endpoints.

The PDF.co API runs in a secure AWS Infrastructure. All files and documents processed by PDF.co are encrypted. For more information on PDF.co security check out https://pdf.co/security

PDF Merger API Benefits

PDF and Non-PDF File Support

Our PDF.co Web API engine supports different document formats. You can mix and merge different file formats in one go. The supported formats are listed in the table above.

Merge Large Files

The PDF Merger API can process large files using the async parameter. The async runs the job processes asynchronously and returns a Job ID. This Job ID can be used to check the status of the job.

PDF Format as Output

The PDF Merger API output format is in PDF. When images or other non-PDF files are merged using the /v1/pdf/merge2 endpoint the output format is in PDF as well.

On-Premise API Server

The PDF Merger API has an on-premise API version and an on-demand version. The on-premise API server is ideal for businesses that prefer to run their program and processes within their own premises. The PDF.co Web API is the on-demand version and all API calls are processed in an encrypted connection.

PDF Merger API Integrations

PDF.co API has over 300+ integrations. Explore them below:

Sign Up

PDF Merger API Sample & Demo

Here are the sample codes and demos accordingly:

PDF Merge 2 Endpoint

As mentioned above, there are 2 PDF Merger endpoints. Because of the difference in file support, we will show different sample codes for each endpoint.

To demonstrate the /v1/pdf/merge2 endpoint, we will use these five (5) sample documents with different file formats. There’s a PDF file, a Word document, a Spreadsheet, a JPG, and a PNG.

PDF Merger Source Files With Different Formats
Screenshots of PDF Merger 2 Source Files With Different Formats

Once the request has been processed. All the documents will be merged into a single PDF.

PDF Merge 2 Output PDF File
Screenshots of PDF Merger 2 Output PDF

Now let’s take a quick look at the /v1/pdf/merge2 endpoint’s parameters and their uses.

Endpoint

URL: https://api.pdf.co/v1/pdf/merge2
Method: POST
Parameter Description
url required. Comma-separated links to source files.
encrypt optional. Enable encryption for the output file: true or false
async optional. Runs processing asynchronously. Returns jobId to use with job/check: true or false
name optional. Output file name.
profiles optional. Must be a String. Set custom configuration. See profiles examples here

cURL Code Snippet for PDF Merge 2

curl --location --request POST 'https://api.pdf.co/v1/pdf/merge2' \
--header 'x-api-key: {{x-api-key}}' \
--form '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/doc-to-pdf/sample.docx' \
--form 'name=result.pdf'

This sample code and other cURL sample codes are available here.

Let’s see the PDF Merge 2 in action using cURL.

Run PDF Merge 2 Using CURL
Call /v1/pdf/merge2 Endpoint Using cURL

The PDF Merge2 JavaScript sample codes are available here.

The PDF Merge2 PHP sample codes are available here.

The sample code for PDF Merge2 in Python is here.

The PDF Merge2 Java sample codes are available here.

The PDF Merge2 C# sample codes are available here.

Sign Up

PDF Merge Endpoint

The /v1/pdf/merge has the same function as PDF Merge 2 except that the file support for this endpoint is exclusively in PDF format. If all of your source files are in PDF format, we recommend that you use this endpoint, otherwise, the /v1/pdf/merge2 endpoint would work best for you.

To demonstrate /v1/pdf/merge, we will use these two (2) PDF files and merge them into a single file.

Two PDF Files As Source Files For PDF Merge
Screenshots of Two PDF Files to Merge

When PDF.co process the request successfully, the output file will look like this.

PDF Merge Endpoint 1 Output
Screenshot of Merged PDF Output File

Let’s quickly go over the /v1/pdf/merge endpoint’s parameters and their uses.

Endpoint

URL: https://api.pdf.co/v1/pdf/merge
Method: POST
Parameter Description
url required. Comma-separated links to source files.
encrypt optional. Enable encryption for the output file: true or false
async optional. Runs processing asynchronously. Returns jobId to use with job/check: true or false
name optional. Output file name.
profiles optional. Must be a String. Set custom configuration. See profiles examples here

cURL Code Snippet for PDF Merge

curl --location --request POST 'https://api.pdf.co/v1/pdf/merge' \
--header 'x-api-key: {{x-api-key}}' \
--form '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' \
--form 'name=result.pdf'

PDF Merge cURL sample codes are available in our repository here.

Let’s see the PDF Merge in action using cURL.

Run PDF Merge Endpoint Using Curl
Calling /v1/pdf/merge Endpoint using cURL

PDF Merge JavaScript code snippets are available in our repository here.

PDF Merge PHP code snippets are available in our repository here.

The sample code for PDF Merge in Python is here.

PDF Merge Java code snippets are available in our repository here.

PDF Merge C# code snippets are available in our repository here.

Sign Up

Why Use PDF File Merger API

Merge Large Files

You can merge large files easily in a matter of seconds. Most PDF merging API will do it much slower, if you open two or more large PDF files, and try to merge them. Our API allows you to select large files and merge them automatically.

Choose Pages to Merge

Our API tool allows you to select the individual pages or a range of pages you want to be included in the merged PDF. You can also choose to merge entire PDF documents. Overall, that gives you greater flexibility on how you merge your PDFs.

Encryption

Privacy has become a big legal issue, and there are laws that require those handling protected private data, to encrypt it, when transmitting or storing it. Our merger API allows you to encrypt the merged output file.

To encrypt the output file, set “encrypt” as “true”. In that regard, our PDF Merger API helps you to comply with privacy laws. It also protects your business from lawsuits and government fines.

Asynchronously Merge Large PDF Files

The API’s code to merge PDF files can run asynchronously, to avoid timeouts. Users can merge documents in the background, and download them without having to refresh their browsers.

PDF Merger API – Frequently Asked Questions

How Do I Combine PDF Files In Bulk?

You can combine PDF files in bulk into one PDF using our PDF Merger API, by uploading the PDFs, and calling the API, as we have described above. The process is fast for fewer than 100 pages.

However, for more than 100 pages, you will have to combine them asynchronously, as we have also described above.

The cost of combining the PDF files in bulk is much lower because you get discounts for buying the credits in bulk. Our PDF merger API is suited to small and large businesses, as well as personal use.

Is PDF Merge Legit?

Our PDF merger API is legit and safe to use because we do not store any of your data online. Furthermore, the API encrypts the transmission of PDF data, which protects it from hackers. You can therefore use it to merge sensitivity data with total peace of mind.

Which is the Best PDF Merger API?

While there are many PDF merge applications online, we recommend that you use our PDF.co Merger API because it gives you total control of the merging process. You have an option to merge two documents, or thousands of documents securely, without the use of expensive licenses. You will only spend a few cents on each PDF merge.

Can I integrate PDF.co Merger API?

We created several integrations of our API and powerful business automation platforms. These integrations include Zapier and Integromat plugins, UiPath, and BluePrism extensions, but we have 300+ more integrations ready. You can easily connect with the most popular applications through our PDF.co API integrations.

Is Combine PDF Safe?

Yes, it is safe to combine PDF files using our PDF merge API. You have an option to delete the files after the merging is complete. If you do not delete them, our API will delete them automatically after about two hours.

How Do I Merge PDF Files Automatically?

Our PDF merger API can help you to merge PDF files automatically. You can choose to have it automatically merge your PDFs online, or from your local server. To merge PDF files automatically with our API, you need to upload the files to the API server.

You can then make an API call to merge the PDF automatically and will take less than 25 seconds, for a few than 100 PDF pages. However, if the PDF you want to merge automatically exceeds 100, then you must run the process in the background.

API PDF Merge Code

We also have PDF merge code samples, which you can use to create your own when using our API. Feel free to contact us if you need help using our PDF Merger API.

SIGN UP

Related Samples: