Code128Symbol

An encoded GS1-128 symbol.

Draw it from widths (or toModules) at a whole number of pixels or printer dots per module, with at least Gs1Code128.QUIET_ZONE_MODULES light modules on each side.

Properties

Link copied to clipboard

GS1 data characters, separators included (the limit is Gs1Code128.MAX_DATA_CHARACTERS).

Link copied to clipboard

Human readable interpretation to print near the bars, e.g. (01)09501101020917(10)ABC123.

Link copied to clipboard

Width of the symbol in modules, quiet zones excluded.

Link copied to clipboard

Code 128 symbol character values: start, data, check character and stop (106).

Link copied to clipboard

Widths in modules of alternating bars and spaces, starting and ending with a bar. Quiet zones excluded.

Functions

Link copied to clipboard
fun maxXDimensionMm(quietZone: Int = Gs1Code128.QUIET_ZONE_MODULES): Double

Largest module width (mm) that keeps the symbol within Gs1Code128.MAX_LENGTH_MM.

Link copied to clipboard
fun toModules(quietZone: Int = Gs1Code128.QUIET_ZONE_MODULES): BooleanArray

One entry per module, true for dark (bar), with quietZone light modules on each side.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun Code128Symbol.toSvg(moduleSize: Double = 2.0, unit: String = "", barHeight: Int = 60, quietZone: Int = Gs1Code128.QUIET_ZONE_MODULES, humanReadable: Boolean = true, fontSize: Int = 8, fontFamily: String = "monospace", darkColor: String = "#000000", lightColor: String? = "#ffffff"): String

Renders the symbol as an SVG document.

Link copied to clipboard
fun widthMm(xDimensionMm: Double, quietZone: Int = Gs1Code128.QUIET_ZONE_MODULES): Double

Physical width for a module width of xDimensionMm, including quiet zones.