Skip to content
Documentation

Mail Merge Basics

Learn how to create personalized PDFs from your templates and spreadsheet data using Mergram's visual editor.

What is Mail Merge?

Mail merge lets you combine a PDF template (like an invoice, certificate, or letter) with a spreadsheet of data — names, emails, amounts — to generate personalized documents for each row. Mergram supports two editor modes for placing data fields onto your PDF.

Before you begin

Have your PDF template and spreadsheet ready. Ensure the first row of your spreadsheet contains clear column headers with no blank rows above them. Supported formats: PDF, PNG, JPG for templates; XLSX, XLS, ODS, CSV, TSV for data.


Canvas Mode

Canvas mode gives you a free-form visual editor where you drag and drop spreadsheet columns directly onto the PDF. Each field becomes a positioned box you can resize, move, and style.

  1. Upload your PDF template

    Go to the editor and upload the PDF you want to personalize. This acts as the background for all merged documents.

  2. Upload your spreadsheet

    Upload an Excel file (.xlsx, .xls, .ods, .csv, .tsv) or connect a Google Sheet. Mergram reads the column headers as available merge fields.

  3. Drag fields onto the canvas

    From the sidebar, drag column headers (e.g. Name, Amount, Date) onto the PDF canvas. Position each field exactly where you want the data to appear. Resize fields by dragging their corners.

  4. Configure field properties

    Click any field to configure its render type:

    • Text — Default. Renders the cell value as text with configurable font, size, color, and alignment.
    • Image — Renders an image by matching spreadsheet data with filenames in your team’s Media Albums. Scales to cover the bounding box width, maintaining aspect ratio. Aligned to top-left.
    • QR Code — Generates a QR code from the cell value. Scales to cover the bounding box width, maintaining square aspect ratio.
    • Barcode — Renders a barcode from the cell value. Scales to cover the bounding box width. Height is controlled by the barcode height setting. Use the height and margin settings in the toolbar to control dimensions.

    For text fields, you can also adjust:

    • Font family and size — Choose from built-in fonts or custom uploaded fonts
    • Text color — Pick any color using the color picker
    • Alignment — Left, center, or right alignment within the field bounds
    • Margins — Add padding inside the field bounds to prevent text from touching edges
  5. Preview and merge

    Use the row selector to preview individual rows in real time. When ready, click Merge to generate all PDFs at once. Single-row previews run in your browser; larger batches are processed server-side.


Multi-Sheet Workbook Picker

When you upload a spreadsheet file with multiple worksheet tabs (e.g. .xlsx or .ods), Mergram shows a Sheet Picker dialog so you can choose which worksheet to use as your data source.

  • Automatic detection — Single-sheet files (including .csv and .tsv) are loaded immediately. The picker only appears for multi-tab workbooks.
  • Tab selection — Each worksheet tab is listed with its name, row count, and column count. Click a tab to select it.
  • Preview info — The footer shows the selected sheet’s dimensions before you confirm.

Organize your data

Keep related data on separate tabs in your workbook and select the right one in the picker. For example, use one tab per month for invoices or per department for certificates.


Form Mode

If your PDF contains fillable form fields (AcroForm), Mergram can auto-detect them and map them to spreadsheet columns. This is ideal for standardized forms like tax documents, applications, and certificates.

  1. Upload a PDF with form fields Upload a PDF that has fillable form fields. Mergram will auto-detect all fields and list them in the sidebar.

  2. Map columns to form fields For each detected form field, select which spreadsheet column should fill it. Column names that match field names are auto-mapped.

  3. Merge Preview any row, then merge. Each output PDF has its form fields filled with the corresponding row data.

Not sure which mode to use?

Canvas mode works with any PDF. Form mode only works with PDFs that have fillable form fields. If Mergram detects form fields, you’ll see both options — choose whichever fits your workflow.


Output Configuration

Before merging, you can configure:

  • Filename template — Use patterns like Invoice_[[Name]] to name output files dynamically based on spreadsheet data.
  • Password protection — Set a password per document using a column value (e.g., a customer ID or unique code).
  • Combine vs. split — Generate one combined PDF containing all rows, or individual PDFs per row.

Best Practices

  • Preview multiple rows — Cycle through at least 5–10 rows in the preview before merging to catch layout or data issues.
  • Use consistent formatting — Format dates, currency, and phone numbers consistently in your spreadsheet for uniform output.
  • Check field overlap — Zoom in on the canvas to verify fields do not overlap, especially when data values vary in length.
  • Save as template — After perfecting your layout, save it as a template so you can reuse it without setting up fields again.

Limitations

  • Maximum rows — Up to 100,000 rows per merge job.
  • Image rendering — Only PNG and JPEG images are supported in image fields.
  • Form field styling — In Form Mode, field styling is inherited from the PDF. Use Canvas Mode for full control over fonts and colors.
  • Combined PDF limitations — When merging in “combine” mode (all rows in one PDF), per-row filename templates and per-row password encryption are not available. These options require “split” mode (individual PDFs per row).