Skip to main content
Learn how to include additional documents (like terms & conditions, brochures, or forms) alongside your letters. Each recipient receives a copy of all extra documents.
Letter only: Extra documents are only available for letters, not postcards (which have a fixed size).

What are Extra Documents?

Extra documents are additional PDF, Word, or RTF files that get included with each letter in your print job. They’re perfect for:
  • Terms & conditions
  • Product brochures
  • Application forms
  • Return slips
  • Promotional materials

Basic Usage

Add one or more extra documents to your print job:
import Intelliprint from 'intelliprint';
import fs from 'fs';

const ip = Intelliprint('your-api-key-here');

const printJob = await ip.prints.create({
  testmode: true,
  content: '<h1>Welcome Letter</h1><p>...</p>',
  recipients: [{address: {/* ... */}}],
  
  // Add extra documents
  extra_documents: [
    {
      document: fs.createReadStream('./terms-and-conditions.pdf')
    },
    {
      document: fs.createReadStream('./product-brochure.pdf')
    }
  ],
  
  confirmed: true
});

console.log('Letter pages:', printJob.letters[0].pages);
// Includes main letter + all extra document pages
Each recipient gets: Main letter + ALL extra documents in the order specified.

Document Order Matters

Extra documents are printed in the order they appear in the array:
extra_documents: [
  { document: './page1.pdf' },  // Printed first
  { document: './page2.pdf' },  // Printed second
  { document: './page3.pdf' }   // Printed last
]
Physical order in envelope:
  1. Main letter (with address)
  2. Extra document 1
  3. Extra document 2
  4. Extra document 3

Apply Backgrounds to Extra Documents

You can apply backgrounds to extra documents:
const printJob = await ip.prints.create({
  testmode: true,
  content: '<h1>Main Letter</h1>',
  recipients: [{address: {/* ... */}}],
  
  // Define backgrounds
  background: {
    first_page: 'bg_letterhead',
    other_pages: 'bg_footer'
  },
  
  extra_documents: [
    {
      document: fs.createReadStream('./terms.pdf'),
      apply_background: true  // Uses 'other_pages' background
    },
    {
      document: fs.createReadStream('./brochure.pdf'),
      apply_background: false  // No background (default)
    }
  ],
  
  confirmed: true
});
When apply_background: true, the other_pages background (not first_page) is applied to all pages of that extra document.

Using Base64 Encoded Documents

For programmatically generated documents:
const pdfBase64 = Buffer.from(pdfBytes).toString('base64');

const printJob = await ip.prints.create({
  testmode: true,
  content: '<h1>Letter</h1>',
  recipients: [{address: {/* ... */}}],
  
  extra_documents: [
    {
      document: {
        content: pdfBase64,
        name: 'generated-terms.pdf'
      }
    }
  ],
  
  confirmed: true
});

Real-World Examples

Example 1: Contract with Terms

async function sendContract(clientData) {
  const printJob = await ip.prints.create({
    testmode: false,
    
    // Main contract letter
    content: `
      <h1>Service Agreement</h1>
      <p>Dear ${clientData.name},</p>
      <p>Please find your service agreement enclosed.</p>
      <p>Review the terms and conditions, sign the agreement,
         and return it to us in the enclosed envelope.</p>
    `,
    
    recipients: [{address: clientData.address}],
    
    // Include standard terms
    extra_documents: [
      {
        document: fs.createReadStream('./standard-terms.pdf'),
        apply_background: true
      },
      {
        document: fs.createReadStream('./return-envelope-slip.pdf')
      }
    ],
    
    background: {
      first_page: 'bg_letterhead',
      other_pages: 'bg_footer'
    },
    
    postage: {
      service: 'uk_first_class_signed_for'  // Signed For (proof of delivery, not full tracking)
    },
    
    reference: `Contract ${clientData.id}`,
    confirmed: true
  });
  
  return printJob;
}

Example 2: Marketing Campaign with Brochure

async function sendMarketingCampaign(campaignData) {
  const printJob = await ip.prints.create({
    testmode: false,
    
    // Personalised letter
    content: `
      <h1>Exclusive Offer for You!</h1>
      <p>Dear {first_name},</p>
      <p>We've enclosed our latest product catalogue with
         special pricing just for valued customers like you.</p>
    `,
    
    mailing_list: campaignData.mailing_list_id,
    
    // Include product brochure
    extra_documents: [
      {
        document: fs.createReadStream('./product-catalogue.pdf')
      },
      {
        document: fs.createReadStream('./discount-coupon.pdf')
      }
    ],
    
    background: {
      first_page: 'bg_marketing_header'
    },
    
    confirmed: true
  });
  
  console.log(`Campaign sent to ${printJob.letters.length} recipients`);
  return printJob;
}

Example 3: Invoice with Return Slip

async function sendInvoiceWithReturnSlip(invoiceData) {
  // Generate invoice PDF
  const invoicePdf = await generateInvoicePDF(invoiceData);
  
  const printJob = await ip.prints.create({
    testmode: false,
    
    // Cover letter
    content: `
      <h1>Invoice Enclosed</h1>
      <p>Dear ${invoiceData.customer_name},</p>
      <p>Please find your invoice enclosed.</p>
      <p>Payment is due within 30 days.</p>
    `,
    
    recipients: [{address: invoiceData.customer_address}],
    
    extra_documents: [
      {
        // The actual invoice
        document: {
          content: invoicePdf.toString('base64'),
          name: `invoice-${invoiceData.number}.pdf`
        },
        apply_background: true
      },
      {
        // Return payment slip
        document: fs.createReadStream('./payment-return-slip.pdf')
      }
    ],
    
    background: {
      first_page: 'bg_letterhead',
      other_pages: 'bg_footer'
    },
    
    reference: `Invoice ${invoiceData.number}`,
    confirmed: true
  });
  
  return printJob;
}

Important Considerations

  • PDF (recommended)
  • Microsoft Word (.docx)
  • RTF (.rtf)
Images (JPG, PNG) are not supported for extra documents.
Extra documents add to the total page count, which affects:
  • Cost: More pages = higher cost
  • Envelope size: May require larger envelope
  • Weight: May affect postage service options
  • Maximum 50MB per extra document
  • Maximum 1000 total pages per print job (including all extras)
Intelliprint automatically selects the appropriate envelope size based on total page count. You can specify a preferred size with postage.ideal_envelope.

Cost Calculation

Extra documents increase the cost per letter based on page count:
// Example cost breakdown
const main_letter = 1 page   // Base cost
const terms = 2 pages         // Adds cost for 2 pages
const brochure = 4 pages      // Adds cost for 4 pages
// Total: 7 pages per letter

// Cost scales with page count
// Check actual costs with a test print job
Use testmode: true to see exact costs before sending for real.Learn more about cost calculation →

Best Practices

Only include documents that add value for the recipient. Too many pages increases costs and may seem overwhelming.
Always test with a single recipient first to verify:
  • Document order is correct
  • Backgrounds apply properly
  • Total page count is as expected
  • Envelope size is appropriate
  • Compress PDFs before uploading
  • Use appropriate image resolution (300 DPI for print)
  • Remove unnecessary pages or content
For multi-page extra documents, consider double-sided printing to save on pages:
printing: {
  double_sided: 'yes'
}

Next Steps