Barcode
Renders a QR code, Code 128 barcode, or EAN-13 barcode inline in the flow layout.
Attributes
Section titled “Attributes”| Attribute | Type | Default | Description |
|---|---|---|---|
type |
string | — | Required. qr, code128, or ean13 |
data |
string | — | Required. Payload string to encode |
size |
token/pt | — | Uniform size (width and height) for QR codes |
width |
token/pt | — | Width constraint |
height |
pt | — | Height constraint |
ec |
string | M |
QR error correction: L M Q H |
hrt |
boolean | false | Show human-readable text below Code128/EAN-13 |
color |
color | #000000 |
Barcode foreground color |
background |
color | — | Background color |
QR code
Section titled “QR code”<barcode type="qr" data="https://lpdf.io" size="80pt"/>L.barcode({ type: 'qr', data: 'https://lpdf.io', size: '80pt' })L.barcode(BarcodeAttr(type='qr', data='https://lpdf.io', size='80pt'))L::barcode(new BarcodeAttr(type: 'qr', data: 'https://lpdf.io', size: '80pt'))L.Barcode(new() { Type = "qr", Data = "https://lpdf.io", Size = "80pt" })QR with high error correction
Section titled “QR with high error correction”<barcode type="qr" data="https://lpdf.io/docs" size="100pt" ec="H"/>L.barcode({ type: 'qr', data: 'https://lpdf.io/docs', size: '100pt', ec: 'H' })L.barcode(BarcodeAttr(type='qr', data='https://lpdf.io/docs', size='100pt', ec='H'))L::barcode(new BarcodeAttr(type: 'qr', data: 'https://lpdf.io/docs', size: '100pt', ec: 'H'))L.Barcode(new() { Type = "qr", Data = "https://lpdf.io/docs", Size = "100pt", Ec = "H" })Code128 with human-readable text
Section titled “Code128 with human-readable text”<barcode type="code128" data="INV-2026-001" width="160pt" height="48pt" hrt="true"/>L.barcode({ type: 'code128', data: 'INV-2026-001', width: '160pt', height: '48pt', hrt: 'true' })L.barcode(BarcodeAttr(type='code128', data='INV-2026-001', width='160pt', height='48pt', hrt='true'))L::barcode(new BarcodeAttr(type: 'code128', data: 'INV-2026-001', width: '160pt', height: '48pt', hrt: 'true'))L.Barcode(new() { Type = "code128", Data = "INV-2026-001", Width = "160pt", Height = "48pt", Hrt = "true" })EAN-13
Section titled “EAN-13”<barcode type="ean13" data="5901234123457" width="120pt" height="48pt" hrt="true"/>L.barcode({ type: 'ean13', data: '5901234123457', width: '120pt', height: '48pt', hrt: 'true' })L.barcode(BarcodeAttr(type='ean13', data='5901234123457', width='120pt', height='48pt', hrt='true'))L::barcode(new BarcodeAttr(type: 'ean13', data: '5901234123457', width: '120pt', height: '48pt', hrt: 'true'))L.Barcode(new() { Type = "ean13", Data = "5901234123457", Width = "120pt", Height = "48pt", Hrt = "true" })The payload is fixed in the XML: data-value does not change data.