Free plan

Merge PDFs

Combine several PDFs into one document
POST
/v1/pdfs/merge

About this tool

This tool joins two or more PDFs into a single PDF. By default the files follow one after another in the order you added them, and you can sort them by file name instead. You can also mix their pages in turns, taking a set number of pages from each file in each round, and insert a blank page between files.
For example, you have an invoice and three receipts as separate PDFs and want to send them as one file.

How to use it

  1. Choose this tool.
  2. Add two or more PDFs, with Upload or by dragging them in.
  3. Choose the order: as added, sorted by name, or mixed page by page.
  4. If you like, turn on a blank page between files.
  5. Press Generate, then download the merged PDF.

What you get back

You get one new PDF containing all your files. You can download it.
TEST IT LIVE

Try Merge PDFs in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/merge
Tool ID
pdfs.merge
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/merge" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'files=@document.pdf' \
  -F 'mode=concatenate' \
  -F 'collateSize=1' \
  -F 'response=url'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.merge({
    "files": 'document.pdf',
    "mode": "concatenate",
    "collateSize": 1,
    "response": "url"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->merge([
    'files' => 'document.pdf',
    'mode' => 'concatenate',
    'collateSize' => 1,
    'response' => 'url',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Combine several PDFs into one document.

Merge PDFs accepts PDF. You can send several files in one request.

Merge PDFs is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/merge with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.