BarcodeNode

data class BarcodeNode(val data: String, val symbology: BarcodeSymbology = BarcodeSymbology.Code128, val width: Dp? = null, val height: Dp = Dp(50f), val color: PdfColor = PdfColor.Black, val background: PdfColor? = PdfColor.White) : PdfNode

A Code 128 barcode rendered as vector bars.

Encoding (code sets B / C with automatic digit-run compression and a mod-103 checksum) happens in common code via com.conamobile.pdfkmp.barcode.Code128Encoder. Characters outside printable ASCII (32–126) are rejected at build time.

Code 128 readers expect a quiet zone of ~10 modules on both sides; give the node some horizontal breathing room.

Constructors

Link copied to clipboard
constructor(data: String, symbology: BarcodeSymbology = BarcodeSymbology.Code128, width: Dp? = null, height: Dp = Dp(50f), color: PdfColor = PdfColor.Black, background: PdfColor? = PdfColor.White)

Properties

Link copied to clipboard

fill behind the bars; null for transparent.

Link copied to clipboard

bar colour.

Link copied to clipboard

payload; the accepted alphabet depends on symbology (printable ASCII for Code 128, digits for EAN-13 / UPC-A).

Link copied to clipboard
val height: Dp

bar height. 1D barcodes carry no data vertically, so this is purely about scanner ergonomics — taller is easier to scan.

Link copied to clipboard

which 1D encoding to use; defaults to Code 128.

Link copied to clipboard
val width: Dp? = null

rendered width; null uses one PDF point per module, the symbol's natural crisp size.