Barcodes & QR

BarcodeControl · QrCodeControl

Turn a value into a barcode or a QR code, drawn as inline SVG.

Overview

BarcodeControl and QrCodeControl are Blazor barcode generators that draw a value as a QR code or one of nine linear barcodes, such as EAN-13. Use them for bin tags, shipping labels, packing slips or a link to share: the code is encoded in C# with ZXing.Net and drawn as inline SVG, so there is no image file to serve. A value the type cannot encode shows the encoder's message instead of bars.

Examples

#Barcode

Build a bin tag: pick a product and the symbology the scanner needs, or edit the value. Break a symbology's rules (EAN-13 wants 12 or 13 digits) and the encoder's message replaces the bars.

C-02-01
Camping stove · Bulk zone
SKU-48213

#QR code

Choose what scanning the packing slip should do: the same control encodes a link, an email address, a phone number or a map position. Higher error correction survives more damage and needs more modules.

Shipment SHP-0456
Road freight · 12 cartons · Dock 4
Scan to track the shipment
Size 140 px
Encodes https://forkliftandfound.example/track/SHP-0456

Documentation

ParameterTypeDefaultDescription
Valuestring"FLEX-12345"Text to encode. Empty draws no code; the empty frame stays.
TypeBarcodeTypeCode128Symbology; see the table below.
ShowTextbooltrueDraws the value under the bars.
ForegroundColor / BackgroundColorstring#000000 / #ffffffBar and text color; background rectangle. Any CSS color.
BarHeightint50Bar height in SVG units (pixels at default size); at least 1.
Width / Heightstring?nullCSS size of the SVG. Unset means the natural size: one unit per module plus a 20-unit quiet zone on each side (40 in total), and the bar height plus 27 (text) or 10.
AriaLabelstring?nullOverrides the default "Type barcode: value".
CssClass / Style (base)string?nullOn the fx-barcode frame. Visible from the base is not applied.
Enabled / Id / Title / Tag / Data / Parent (base)nullAccepted but have no effect. A written id binds to Id, so it does not reach the frame.
(unmatched attributes)Dictionary<string,object>—Written on the frame <div>.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.