Free plan

Merge Documents

Combine several documents into one PDF
POST
/v1/documents/merge

About this tool

This tool joins documents of different kinds into one PDF, in the order you give them. It accepts Word, Excel, PowerPoint, text, web pages, PDFs and pictures. It can add a bookmark (a clickable shortcut in the PDF) at the start of each file, with the file name or your own title.
For example, you combine a Word cover letter, an Excel table and a scanned photo into one PDF to send.

How to use it

  1. Choose this tool.
  2. Add your files in the order you want them, using Upload or drag and drop.
  3. Choose whether to add a bookmark for each file.
  4. Press Generate.
  5. Download the combined PDF.

What you get back

You get one PDF containing all your files in order, ready to download.
GOOD TO KNOW
Many files in, one PDF out; counts as one document. At most 5000 pages. Use the PDF merge tool when every file is already a PDF.
TEST IT LIVE

Try Merge Documents 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
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/merge
Tool ID
documents.merge
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/merge" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'files=@document.pdf' \
  -F 'bookmarks=false' \
  -F 'titles=["Cover","Contract","Annex"]' \
  -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.documents.merge({
    "files": 'document.pdf',
    "bookmarks": false,
    "titles": "[\"Cover\",\"Contract\",\"Annex\"]",
    "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->documents()->merge([
    'files' => 'document.pdf',
    'bookmarks' => false,
    'titles' => '["Cover","Contract","Annex"]',
    'response' => 'url',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Join documents of different kinds (Word, Excel, PowerPoint, OpenDocument, text, Markdown, HTML, PDF and pictures) into one PDF, in the order you give them, with an optional bookmark for each file.

Merge Documents works from text and settings, so no file is needed. Every input is optional.

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

Send a POST request to /v1/documents/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.