Millions became refugees in 2022. Support children and their families via Unicef Free Webinar for Beginners

HOW TO MERGE PDF FILES USING OUR API

The PDF.co PDF Merger API can merge a mix of different document formats into a single PDF. 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.

  • Supported File Formats:
  • PDF
  • DOC / DOCX / RTF/ Word
  • XLS / XLSX / CSV
  • JPG / PNG / TIFF
  • TXT
  • EML / MSG email messages with attachments
How many PDF documents can merged
From ZIP, DOC, XLS, PDF in 1 hour
Merge PDF FIles with PDF.co

What Our Customers Are Saying:

PDF Merger API Benefits

There are two PDF Merger API endpoints.

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.

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.

Web API Supports Multiple Languages

PDF.co platform can be used by software developers from programming languages such as PHP, Javascript, .NET and ASP.NET, C#, Java, Visual Basic, and many others. Find source code samples in our API documentation.

Business Automation Platforms Integrations

If you are not a developer, you can also easily automate your PDF operations via popular business automation platforms: ZapierMakeAirtableSalesforceGoogle Apps Script, and 300+ more.

PDF Merge 2 Endpoint Sample & Demo

As mentioned above, there are 2 PDF Merger endpoints.
Because of the difference in file support, we will show different source code samples 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.

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.

Screenshots of PDF Merger 2 Output PDF

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/checktrue 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'

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

Call /v1/pdf/merge2 Endpoint Using cURL

PDF Merge Endpoint Sample & Demo

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.

Screenshots of Two PDF Files to Merge

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

Screenshot of Merged PDF Output File

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/checktrue 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'

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

Calling /v1/pdf/merge Endpoint using cURL