Gs1Code128

GS1-128 encoder: Code 128 (ISO/IEC 15417) with FNC1 right after the start character.

val symbol = Gs1Code128.encode(Gs1Message.parse("(01)09501101020917(10)ABC123"))
symbol.widths // bar/space widths in modules, starting with a bar
symbol.humanReadable // (01)09501101020917(10)ABC123

Properties

Link copied to clipboard
const val MAX_DATA_CHARACTERS: Int = 48

Maximum number of data characters in one GS1-128 symbol, separators included.

Link copied to clipboard
const val MAX_LENGTH_MM: Double = 165.1

Maximum physical length of a GS1-128 symbol, quiet zones included, in millimetres.

Link copied to clipboard
const val QUIET_ZONE_MODULES: Int = 10

Minimum quiet zone on each side, in modules.

Functions

Link copied to clipboard
fun encode(message: Gs1Message, enforceMaxDataCharacters: Boolean = true): Code128Symbol

Encodes message, choosing Code Sets C and B to produce the shortest symbol.