Last updated: May 29, 2024

<span aria-hidden="true" id="introducing-the-new-pdf-merge-robot-at-transloadit"></span>

# Introducing the new PDF merge Robot at Transloadit

![Joseph Grabski](/assets/images/teammates/joseph2.png?dpl=dpl_DM8JrFduDL1oLK4J3qc9o5gMffMy)

**Joseph Grabski**

Content Lead · Rochester, United Kingdom · Show bio

[](https://x.com/joe%5Fgrabski)[](https://github.com/Missing-Tech)

We love our Robots, so it's always a pleasure to announce the release of a new one! In today's blog, we get the opportunity to do just that, by welcoming our[/document/merge](/docs/robots/document-merge.md) Robot to the team.

![Bright blue background with a paint splat in the middle revealing the text 'Introducing /document/merge' in a graffiti style](/_next/static/immutable/media/opengraph-image.1wad7qft-zg1-.png)

As you may have already assumed, the [/document/merge](/docs/robots/document-merge.md) Robot concatenates several PDFs, to form a single output document. Moreover, theRobot supports merging several password-protected PDFs – simply supply it with an array of input passwords. You can protect the output PDF as well, by providing an output password. This way, you can be sure that your secrets stay *secret*.

<span aria-hidden="true" id="merging-two-pdfs"></span>

## Merging two PDFs

Let's see it in action! The below Template will take two password-protected PDFs and merge them together. You may also be interested in using one of our[SDKs](/docs/sdks.md), to easily automate the bulk processing of documents, or for sanitizing user-inputted documents.

```
<!-- This pulls Uppy from our CDN -->
<!-- For smaller self-hosted bundles, install Uppy and plugins manually: -->
<!-- npm i --save @uppy/core @uppy/dashboard @uppy/remote-sources @uppy/transloadit ... -->
<link
  href="https://releases.transloadit.com/uppy/v3.10.0/uppy.min.css"
  rel="stylesheet"
/>
<button id="browse">Select Files</button>
<script type="module">
  import {
    Uppy,
    Dashboard,
    ImageEditor,
    RemoteSources,
    Transloadit,
  } from 'https://releases.transloadit.com/uppy/v3.10.0/uppy.min.mjs'
  const uppy = new Uppy()
    .use(Transloadit, {
      waitForEncoding: true,
      alwaysRunAssembly: true,
      assemblyOptions: {
        params: {
          // It's often better store encoding instructions in your account
          // and use a `template_id` instead of adding these steps inline
          steps: {
            ':original': {
              robot: '/upload/handle',
            },
            merge: {
              use: {
                steps: [':original'],
                bundle_steps: true,
              },
              robot: '/document/merge',
              result: true,
              input_passwords: ['password1', 'password2'],
            },
            exported: {
              use: ['merge', ':original'],
              robot: '/s3/store',
              credentials: 'demo_s3_credentials',
              url_prefix: 'https://demos.transloadit.com/',
            },
          },
        },
      },
    })
    .use(Dashboard, { trigger: '#browse' })
    .use(ImageEditor, { target: Dashboard })
    .use(RemoteSources, {
      companionUrl: 'https://api2.transloadit.com/companion',
    })
    .on('complete', ({ transloadit }) => {
      // Due to `waitForEncoding:true` this is fired after encoding is done.
      // Alternatively, set `waitForEncoding` to `false` and provide a `notify_url`
      console.log(transloadit) // Array of Assembly Statuses
      for (const assembly of transloadit) {
        console.log(assembly.results) // Array of all encoding results
      }
    })
    .on('error', (error) => {
      console.error(error)
    })
</script>

```

[Read docs](/docs/sdks/uppy.md)

As you can see, by passing in an array of passwords to the `input_passwords` parameter, Transloadit processes the PDFs. The documents are then stitched together into a single output PDF, which is shown below.

![The open PDF showing two documents merged together, with Transloadit on the left page and Uppy on the right page.](/_next/static/immutable/media/2023-09-document-merge-example.2ng-3-j8n83mz.png)

And if you're looking to password protect the output file too, that's no problem! Simply add the`output_password` parameter, and supply the password you'd like to use.

```json
{
  "steps": {
    "merge": {
      "use": {
        "steps": [":original"],
        "bundle_steps": true
      },
      "robot": "/document/merge",
      "input_passwords": ["password1", "password2"],
      "output_password": "transloadit",
      "result": true
    },
    "exported": {
      "use": ["merge", ":original"],
      "robot": "/s3/store",
      "credentials": "YOUR_AWS_CREDENTIALS",
      "url_prefix": "https://demos.transloadit.com/"
    }
  }
}

```

Now your important PDF is safely kept away from unwanted eyes, even if a third party manages to get their hands on your documents.

<span aria-hidden="true" id="wrapping-up"></span>

## Wrapping up

That's it for today's look at our latest Robot. We've got a few more that are ready to be introduced, so stay tuned for future updates on all things Transloadit by signing up for the[Dev Times](/newsletters.md) below.

[#assembly](/blog/tags/assembly.md)[#document-merge-robot](/blog/tags/document-merge-robot.md)[#walkthrough](/blog/tags/walkthrough.md)

### 👩‍💻 Join 20k+ developers

Sign up for our [monthly newsletter](/newsletters.md) to receive direct links to 3 exclusive tech — and 2 product updates. No less, no more.

Your email:

Get access

## File uploading and encoding. Made simple.

Transloadit streamlines file handling for developers, trusted by brands like Coursera and The New York Times. We’re known for a reliable API, top-notch support, and a strong commitment to open source, with projects like [Uppy⁠](https://uppy.io) and [Tus⁠](https://tus.io) setting standards in file processing.

[Sign up](/c/)[Book a Demo](https://survey.typeform.com/to/kRg47Xi5)

No credit card needed

Cancel anytime
