Adding barcodes and QR codes to documents
17 September 2025 · 6 min read · Nextarp B.V.
A barcode or QR code turns a printed document into something a scanner can act on - a payment reference, a tracking id, a verification link. Generating them from your data, inside the template, keeps them always correct.
Common use cases
- Payment references - QR codes encoding structured payment data on invoices.
- Logistics - barcodes carrying order or shipment ids.
- Verification - QR codes linking to a document's authenticity portal.
- Inventory and assets - codes on labels and certificates.
Pick the right symbology
Use a linear barcode (Code 128, EAN) for short numeric or alphanumeric ids scanned by traditional readers; use a QR code for URLs, longer payloads or phone-camera scanning. Match the standard your downstream system expects.
Why codes fail to scan
Most scanning failures are avoidable:
- Too small - respect the minimum module size for the print resolution.
- No quiet zone - codes need clear margin around them.
- Low contrast or scaling distortion - keep codes crisp and un-stretched.
- Wrong error-correction level - raise it for codes that may be printed or damaged.
Generate, do not paste
Encoding the code from live data at generation time means it always matches the document. DocsNG can render QR codes and barcodes directly from your fields, sized and positioned in the template.
Related articles
- Word template best practices for reliable generation · Authoring
- Conditional content and loops in templates · Authoring
- eIDAS explained: AdES, QES and QSeal for documents · Compliance
DocsNG is the free, self-hostable platform for generating, signing and verifying documents. Get DocsNG or try the live demo.
