How QR code and barcode fields work
QR code and barcode fields generate scannable codes from your spreadsheet data and render them directly onto the PDF canvas. Each row produces a different code based on the cell value.
Before you begin
Prepare your spreadsheet with a column containing the values you want to encode. For barcodes, ensure the data matches the format requirements (e.g., EAN-13 requires exactly 13 digits). For QR codes, any text or URL works.
Using QR Code & Barcode Fields
-
Prepare your spreadsheet
Add a column with the values you want encoded (URLs, product IDs, ticket numbers, etc.).
-
Place a field on the canvas
Drag the column header from the sidebar onto the canvas, just like a text field.
-
Change the render type
Click the field and select QR Code or Barcode from the render type dropdown.
-
Configure and resize
- QR codes scale to cover the width of the bounding box, maintaining their square aspect ratio. Resize the box to control the QR code dimensions.
- Barcodes scale to cover the bounding box width. Height is controlled by the barcode height setting. Resize the bounding box to control the barcode width, and use the height and margin settings in the toolbar to control the vertical dimensions.
QR Code settings
- Version — Auto-selected based on data length (versions 1–40)
- Scaling — Scales to cover the bounding box width, maintaining square aspect ratio
- Margin — Quiet zone around the QR code (default: 4 modules)
- Error correction — Built-in error correction ensures readability even with minor damage
- Data capacity — Up to 4,296 alphanumeric characters or 7,089 numeric characters
When to use QR codes
QR codes are ideal for encoding URLs, contact information (vCard), WiFi credentials, ticket identifiers, and any data that needs to be scanned by a smartphone. They can encode much more data than barcodes.
Barcode settings
Mergram supports multiple barcode formats:
-
Scaling — Barcodes scale 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.
-
Formats:
-
CODE128 — General-purpose, supports full ASCII (alphanumeric + symbols)
-
EAN13 — 13-digit international product barcode
-
EAN8 — 8-digit compact product barcode
-
UPC — 12-digit US/Canada product barcode (UPC-A)
-
UPC-E — 8-digit compact US product barcode
-
CODE39 — Alphanumeric, commonly used in automotive and defense
-
EAN5 — 5-digit supplemental add-on code
-
EAN2 — 2-digit supplemental add-on code
-
ITF — Numeric-only (Interleaved 2 of 5), used in warehousing and shipping
-
ITF-14 — 14-digit shipping container and carton barcode
-
MSI — Numeric-only, used in warehouse inventory
-
Pharmacode — Pharmaceutical packaging (numeric range 3–131070)
-
Codabar — Numeric + select symbols, used in libraries and blood banks
Validation
Some barcode formats have strict requirements (e.g., EAN13 requires exactly 13 digits, EAN8 requires exactly 8 digits, CODE39 supports uppercase letters and digits only). If a value doesn’t match the format, the field will show a warning during preview. Always validate your data before merging.
Common Use Cases
QR Codes
- Event tickets — Encode ticket IDs or verification URLs
- Business cards — Encode vCard contact data
- Product links — Encode product page URLs for packaging
- Authentication — Encode unique verification codes
Barcodes
- Product labels — EAN13 or UPC for retail packaging
- Shipping labels — CODE128 for tracking numbers
- Inventory tags — ITF or MSI for warehouse management
- Pharmaceutical — Pharmacode for medicine packaging
Best Practices
- Test your scans — After merging, scan a few output codes with a barcode scanner or phone camera to verify they encode the correct values
- Size matters — Make QR code fields at least 2 cm × 2 cm (approximately 75 px at 96 DPI) for reliable scanning
- Leave white space — Ensure a quiet zone (white margin) around barcodes and QR codes for reliable scanning
- Use the right format — Choose the barcode format that matches your industry and data type
- Validate data in spreadsheet — Use spreadsheet formulas to verify data matches barcode requirements before merging
Limitations
- Black and white only — QR codes and barcodes are rendered in black and white
- No 2D barcodes except QR — Data Matrix, PDF417, and Aztec are not currently supported
- No custom error correction levels — QR codes use the default error correction level
- No barcode text — The human-readable text below barcodes is not displayed; only the scannable bars are rendered