Docs › Barcodes and QR
QR codes
The QR element, error correction levels, size and length.
A QR code is a square element. size is its side in mm; without a position it goes in the middle. Use it for long values such as order lookup URLs, product pages or stock location codes.
{ type: 'qr', x: 36, y: 4, size: 20, value: 'https://shop.example.com/o/{{orderNo}}', ecc: 'M' }Drawn by the real library
Code for this example
const template = {
v: 1,
name: 'Stock location',
paper: { kind: 'roll', dpi: 203 },
label: { width: 60, height: 30 },
elements: [
{ type: 'qr', x: 3, y: 3, size: 24, value: 'LOC:{{loc}}', ecc: 'Q' },
{ type: 'text', x: 30, y: 5, w: 28, h: 10, text: '{{loc}}', size: 16, bold: true, fit: 'shrink' },
{ type: 'text', x: 30, y: 16, w: 28, h: 10, text: '{{desc}}', size: 8, fit: 'wrap' },
],
};
const rows = [{ loc: 'A-03-12', desc: 'Floor 2, zone A, shelf 3, bin 12' }];
Label82.print(template, rows);Error correction (ecc)
| ecc | Recovers | Use |
|---|---|---|
L | about 7% | Clean indoor labels, long values |
M | about 15% | The default |
Q | about 25% | Warehouses, labels that get scratched |
H | about 30% | Dirty environments |
Size and length
- Modules of 0.25 mm or more read well with phones. Longer values need more modules, so raise
size. - The quiet zone (two modules) is included.
- A value that is too long raises
QrError(qr_too_long) and draws a crossed box. Shorten URLs.
Label82.qrSVG('https://82label.app', { size: 30, ecc: 'M' }); // just the QR picture