Skip to content

Barcode PDF Mail Merge

Add barcodes to your merged PDFs using spreadsheet data. Generate Code 128, EAN-13, UPC-A, and other barcode types for shipping labels, inventory tags, and product IDs.

What is Barcode PDF Mail Merge?

Barcode PDF mail merge lets you embed machine-readable barcodes into merged PDFs using data from your spreadsheet. Each row’s cell value is rendered as a barcode — no manual barcode generation or image handling required.

This is essential for shipping labels, product tags, inventory stickers, warehouse labels, and any document that needs scannable barcode identifiers. Upload your PDF template, connect your data, and every generated document includes the correct barcode for that record.

Who uses this?


How to Add Barcodes to Merged PDFs

Step 1 — Prepare Your Barcode Data

Add a column to your spreadsheet containing the barcode values. Each symbology has specific format requirements:

SymbologyData FormatExampleBest For
Code 128AlphanumericINV-2025-0042General purpose — invoices, tracking IDs
EAN-1312–13 digits5901234123457Retail products, ISBNs
UPC-A11–12 digits012345678905US retail products
Code 39Alphanumeric (uppercase + symbols)PART-9921Industrial, automotive, military
ITF-1413–14 digits15400141288763Shipping containers, cartons
PharmacodeNumber 3–131070117480Pharmaceutical packaging

Data validation

Each barcode symbology enforces strict data format rules. EAN-13 requires exactly 12 or 13 digits — letters or symbols will cause an error. Validate your data before merging, especially for numeric-only symbologies like EAN-13, UPC-A, and ITF-14.

Step 2 — Place a Barcode Field

Drag the barcode column from the sidebar onto your PDF canvas. Click the field and change its render type to Barcode.

Step 3 — Select a Symbology

Choose the barcode type from the field properties panel. Pick the symbology that matches your data format and scanning requirements.

Step 4 — Adjust Size and Position

Barcodes scale horizontally to cover the bounding box width. Height is controlled by the barcode height setting — not the bounding box height. The bounding box controls placement (position) and horizontal sizing.

Sizing tip

For reliable scanning, ensure barcodes are wide enough for your scanner to read. A minimum bounding box width of 1.5–2 inches (approximately 108–144 PDF points) is recommended for Code 128 barcodes. Test with your actual scanner hardware.

Step 5 — Preview and Generate

Use the row selector to preview barcodes with real data. Verify that each value renders correctly and the barcode is scannable at the output size. Then generate your merged PDFs.


Symbology Details

Code 128 — General Purpose

The most versatile barcode type. Supports the full ASCII character set — letters, numbers, and symbols. Ideal for invoice numbers, tracking IDs, order references, and any alphanumeric identifier.

Data format: Any alphanumeric string (e.g., INV-2025-0042, ORD-9921-A, PKG20250115)

Common uses: Invoice numbers, package tracking codes, internal reference IDs, serial numbers

EAN-13 — Retail Products

The global standard for retail product barcodes. Used on consumer goods, books (as ISBN barcodes), and point-of-sale systems worldwide.

Data format: 12 digits (check digit auto-calculated) or 13 digits (including check digit)

Common uses: Product packaging, price labels, book ISBNs, grocery items

UPC-A — US Retail Products

The primary barcode standard for retail products in the United States. Functionally similar to EAN-13 but specifically for the North American market.

Data format: 11 digits (check digit auto-calculated) or 12 digits (including check digit)

Common uses: US retail products, POS scanning, inventory management

Code 39 — Industrial

Widely used in automotive, defense, and industrial manufacturing. Supports uppercase letters, digits, and a limited set of symbols (-, ., $, /, +, %, space).

Data format: Uppercase alphanumeric with limited symbols (e.g., PART-9921, LOT-2025-A)

Common uses: Part numbers, work orders, inventory labels, automotive parts

ITF-14 — Shipping Containers

Designed for marking cartons, cases, and shipping containers in the supply chain. Encodes 14-digit Global Trade Item Numbers (GTIN-14).

Data format: 13 digits (check digit auto-calculated) or 14 digits (including check digit)

Common uses: Shipping containers, outer cartons, warehouse pallet labels, logistics

Pharmacode — Pharmaceutical

Used specifically in the pharmaceutical industry for packaging identification. Encodes a single numeric value.

Data format: Integer between 3 and 131070

Common uses: Medication packaging, pharmaceutical labeling, drug identification


Common Use Cases

Shipping Labels

Generate shipping labels with Code 128 tracking barcodes. Your spreadsheet has columns for recipient name, address, and tracking number. Each label includes a scannable barcode that couriers can scan at every transit point.

Product Price Tags

Create retail price tags with EAN-13 or UPC-A barcodes. Your product spreadsheet includes SKU, price, product name, and barcode number. Generate individual tags for each product — ready to print and attach to shelves.

Inventory and Warehouse Labels

Print bin labels, pallet tags, and location stickers with Code 128 barcodes. Include item descriptions and quantities alongside the barcode for human-readable reference.

Work Orders and Inspection Sheets

Embed Code 39 barcodes on manufacturing work orders. Workers scan the barcode to pull up the correct order details in your ERP or MES system.


Best Practices

  1. Validate data before merging — Ensure all barcode values match the required format for your chosen symbology
  2. Include human-readable text — Place a text field next to the barcode showing the same value, so it can be read manually if scanning fails
  3. Test at actual print size — Preview barcodes at the size they’ll be printed; narrow barcodes may not scan reliably
  4. Use the right symbology — Match the barcode type to your industry and scanner hardware
  5. Keep values consistent — Avoid leading/trailing spaces or invisible characters in your spreadsheet data
  6. Leave quiet zones — Ensure adequate white space around the barcode bounding box for reliable scanning (typically 10x the narrow bar width on each side)

Get Started

Add scannable barcodes to your merged PDFs in minutes. Upload a template, connect your spreadsheet, and generate labeled documents with embedded barcodes.

Try Mergram free and create your first barcode mail merge today.

Step-by-step guide

  1. 1

    Prepare Barcode Data

    Add a column to your spreadsheet with barcode values. Ensure the data matches the required format for your chosen symbology (e.g., 12 digits for EAN-13, alphanumeric for Code 128).

  2. 2

    Place a Barcode Field

    Drag the barcode column from the sidebar onto your PDF canvas. Click the field and change its render type to Barcode.

  3. 3

    Select a Symbology

    Choose the barcode type (Code 128, EAN-13, UPC-A, Code 39, ITF-14, or Pharmacode) based on your use case and data format.

  4. 4

    Adjust Size and Position

    Resize the bounding box to set the barcode width. Use the barcode height setting to control vertical size independently.

  5. 5

    Preview and Generate

    Preview individual rows to verify barcode rendering. Then generate your merged PDFs — individual files, combined document, or email delivery.

Frequently asked questions

What barcode types does Mergram support?
Mergram supports Code 128, EAN-13, UPC-A, Code 39, ITF-14, and Pharmacode. These cover most use cases including shipping labels, retail products, industrial parts, and pharmaceutical packaging.
How do I add a barcode to my merged PDF?
Drag a column header onto the canvas, change its render type to Barcode, and select the symbology. The barcode is generated from the spreadsheet cell value for each row. Resize the bounding box to control placement and width.
What data format does each barcode type require?
Each symbology has specific data requirements. Code 128 and Code 39 accept alphanumeric data. EAN-13 requires exactly 12 or 13 digits. UPC-A requires 11 or 12 digits. ITF-14 requires 13 or 14 digits. Pharmacode requires a numeric value between 3 and 131070. Invalid data produces an error during the merge.
Can I use different barcode types in the same template?
Yes. Each field on the canvas can have its own render type and barcode symbology. You can place a Code 128 field for a tracking number and an EAN-13 field for a product code on the same page.
How are barcodes sized and positioned?
Barcodes scale horizontally to cover the bounding box width. Height is controlled by the barcode height setting, not the bounding box height. The bounding box controls placement (position) and horizontal sizing.
Can I use barcodes with email delivery?
Yes. Barcodes are rendered directly into the PDF. If you send merged PDFs via email, recipients receive PDFs with embedded barcodes that scan normally from both printed and digital copies.

Ready to try it yourself?

Start merging PDFs in minutes — free account required, no credit card needed.

Related articles