Adding Dynamic QR Codes to Merged PDFs
QR codes make your merged documents interactive — recipients can scan to open URLs, verify authenticity, or access personalized content. With Mergram, every merged PDF can contain a unique QR code generated from your spreadsheet data.
Prerequisites
To add QR codes to your merged PDFs, you need:
- A PDF template uploaded to Mergram
- A spreadsheet (Excel, CSV, or Google Sheets) with a column containing the QR code data
- A column with values such as URLs, product IDs, ticket codes, or any text string
QR codes vs. barcodes
Mergram supports both QR codes (2D, scannable from any angle) and linear barcodes (Code 128, Code 39, EAN-13). This guide covers QR codes. The process for barcodes is identical — just select ‘Barcode’ as the render type instead of ‘QR Code’.
Use Cases for QR Codes in Merged PDFs
QR codes add interactivity and verification capabilities to printed and digital documents:
| Use Case | QR Code Content | Benefit |
|---|---|---|
| Event tickets | Check-in URL with ticket ID | Fast, contactless entry |
| Invoices | Payment page link | One-scan payment |
| Certificates | Online verification URL | Instant authenticity check |
| Product labels | Product page or manual link | Customer self-service |
| Business cards | vCard or portfolio URL | Easy contact saving |
| Marketing materials | Landing page or discount code | Trackable campaign links |
| Medical records | Patient portal link | Quick access for patients |
| Shipping labels | Tracking URL | Real-time package status |
Supported Data Types
Any text string from your spreadsheet becomes a scannable QR code. Common formats include:
| Data Type | Example Value | QR Code Format |
|---|---|---|
| URLs | https://example.com/verify/12345 | Opens in browser |
mailto:contact@example.com | Opens email client | |
| Phone | tel:+1234567890 | Initiates phone call |
| vCard | BEGIN:VCARD\nVERSION:3.0\nFN:John... | Adds to contacts |
| WiFi | WIFI:T:WPA;S:MyNetwork;P:password;; | Auto-connects to WiFi |
| Plain text | Any custom string | Displays as text |
Dynamic URLs with merge fields
You can construct QR code URLs dynamically in your spreadsheet. For example, use a formula like ="https://example.com/verify/" & A2 to build unique verification URLs for each row.
Step-by-Step: Adding QR Codes
1. Prepare Your Spreadsheet
Add a dedicated column for QR code data. Each cell value becomes the content of one QR code:
| Name | Event | TicketID | QRData |
|---|---|---|---|
| Alice Chen | Annual Gala | TKT-001 | https://events.example.com/check/TKT-001 |
| Bob Martinez | Annual Gala | TKT-002 | https://events.example.com/check/TKT-002 |
| Carol Johnson | Annual Gala | TKT-003 | https://events.example.com/check/TKT-003 |
2. Place the QR Code Field
In the Mergram editor:
- Select the QRData column from your data fields panel
- Change the render type from “Text” to “QR Code”
- A bounding box appears on the canvas — drag it to your desired position
- Resize the box to control the QR code dimensions — QR codes scale to cover the bounding box width, maintaining their square aspect ratio
3. Preview and Verify
Click Preview to see the QR code rendered with actual data from your first row. Scan it with your phone to verify the content is correct before running the full merge.
Tips for Scannable QR Codes
To ensure your QR codes work reliably in the real world:
- Minimum size: Keep the bounding box at least 1cm × 1cm (about 40px at 72dpi)
- High contrast: Dark QR code on a light background works best
- Quiet zone: Leave a small margin of white space around the QR code (at least 4 modules wide)
- Avoid edges: Don’t place QR codes near page edges or trim areas
- Test on paper: Print a test copy and scan with multiple phone cameras before bulk generation
- Error correction: Mergram generates QR codes with standard error correction — they remain scannable even with minor damage or partial obstruction
Long URLs reduce scannability
QR codes encoding very long strings (over 300 characters) become denser and harder to scan at small sizes. Use URL shorteners or compact identifiers when possible. Shorter content = larger modules = easier scanning.
When to Use QR Codes
QR codes are the right choice when you need to:
- Link physical documents to digital content — event tickets, product packaging, direct mail
- Enable verification — certificates, permits, official documents
- Reduce manual data entry — contact info, WiFi credentials, URLs
- Track engagement — unique URLs per document for analytics
- Bridge print and digital — any document that recipients might scan with a phone
Consider using plain text fields instead when the content is short enough to read at a glance (names, dates, amounts) and doesn’t need to be machine-readable.
Combining QR Codes with Other Features
QR codes work seamlessly with other Mergram features:
- Email campaigns: Send merged PDFs with unique QR codes as email attachments
- Password protection: Encrypt QR-coded PDFs for sensitive documents
- Custom fonts: Pair QR codes with branded typography for professional results
- Image fields: Add logos alongside QR codes for branded materials
Common Issues and Troubleshooting
QR codes not scanning: Ensure the bounding box is large enough and the background has sufficient contrast. Try increasing the box size by 20–30% and test again.
Wrong content encoded: Double-check your spreadsheet column. The QR code encodes exactly what’s in the cell — extra spaces or line breaks will be included.
QR codes appear blurry in print: Ensure the bounding box is large enough for your print resolution. QR codes are rendered as high-resolution PNG images at the bounding box width. If the box is too small, the QR code may not have enough pixels for clean printing at high DPI. Increase the box size and re-merge.
Empty QR codes: If some rows have empty QR code data, those fields will be skipped. Fill in all cells in your QR data column, or filter out rows with missing values before merging.
Get Started
Upload a PDF template, add a QR code field, and see it rendered with real data in the Mergram editor. The free plan includes QR code generation — try it with a sample dataset today.