Ask Anvil

Answers to questions about automating PDFs, e-signatures, Webforms, and other paperwork problems.
E-signatures
Categories

How do I combine multiple PDFs into one e-signature request?

If a signer needs to sign several PDFs at once, do not send one request per document. Every major e-signature API lets you attach multiple files to a single signing session (often called a packet, envelope, or document group) so the signer reviews and signs everything in one flow and you get back one completed record.

List every PDF in one packet

The pattern is the same across providers: build one request, add an array of files, and tell the API which signer signs which fields on which file. With Anvil's Etch e-sign API this is a single createEtchPacket call. Each entry in the files array can be an existing PDF template, a freshly uploaded PDF, or a document generated from HTML or markdown.

const Anvil = require('@anvilco/anvil')
const anvilClient = new Anvil({ apiKey: 'yourApiKey' })

const variables = {
  isDraft: false,
  isTest: true, // set false in production
  files: [
    { id: 'nda', castEid: 'abc123DEF456' },   // existing template
    { id: 'offer', castEid: 'ghi789JKL012' },  // another template
    {
      id: 'w4',                               // a new upload
      title: 'W-4',
      file: Anvil.prepareGraphQLFile('./w4.pdf'),
      fields: [
        {
          id: 'sig',
          type: 'signature',
          pageNum: 0,
          rect: { x: 100, y: 600, width: 150, height: 30 },
        },
      ],
    },
  ],
  signers: [
    {
      id: 'employee',
      name: 'Sally Employee',
      email: 'sally@example.com',
      fields: [
        { fileId: 'nda', fieldId: 'signature' },
        { fileId: 'offer', fieldId: 'signature' },
        { fileId: 'w4', fieldId: 'sig' },
      ],
    },
  ],
}

const { data } = await anvilClient.createEtchPacket({ variables })

Because all three files live in one packet, the signer gets one email (or one embedded signing session) and signs every document in order. One completed packet comes back with a single audit trail covering all of the files, rather than three disconnected records you have to reconcile later. Each signer's fields array names both the file and the field, so a field id that is unique inside one PDF will not collide with the same id in another.

Merge the files into one PDF (optional)

By default each file stays a separate document in the packet. If you would rather the signer see one continuous PDF, add mergePDFs: true at the top level of the variables. Anvil merges the PDFs before signing, so signers sign the combined document and you download one merged file at the end.

Watch how packets are billed

Check how your provider counts multi-document packets. Anvil charges per completed packet, not per document, so a three-PDF packet sent over the API counts as one Etch e-sign packet ($1.50 at list price) and only bills once every signer has finished. Test packets created with a development key or with isTest set to true are free, so you can build and check the layout before sending anything real.

Back to All Questions

The fastest way to build software for documents

Anvil Document SDK is a comprehensive toolbox for product teams launching document flows where PDF filling, signing, and complex conditional scenarios are necessary.
Explore Anvil
Anvil Webforms