toSvg

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(source)

Renders the symbol as an SVG document.

Coordinates are in modules; moduleSize only sets the width/height attributes, in unit. For print, pass the X-dimension in millimetres with unit = "mm" (e.g. moduleSize = 0.495).

Parameters

barHeight

bar height in modules.

humanReadable

print the human readable interpretation under the bars.

fontSize

text height in modules (8 modules is 3.96 mm at X = 0.495 mm; GS1 asks for at least 3 mm).

lightColor

background colour, or null for a transparent background.


fun DataMatrixSymbol.toSvg(moduleSize: Double = 10.0, unit: String = "", quietZone: Int = Gs1DataMatrix.QUIET_ZONE_MODULES, darkColor: String = "#000000", lightColor: String? = "#ffffff"): String(source)

Renders the symbol as an SVG document.

Coordinates are in modules; moduleSize only sets the width/height attributes, in unit. For print, pass the X-dimension in millimetres with unit = "mm". The human readable interpretation is not included: place DataMatrixSymbol.humanReadable near the symbol.

Parameters

lightColor

background colour, or null for a transparent background.


fun QrCodeSymbol.toSvg(moduleSize: Double = 10.0, unit: String = "", quietZone: Int = QrCode.QUIET_ZONE_MODULES, darkColor: String = "#000000", lightColor: String? = "#ffffff"): String(source)

Renders the symbol as an SVG document.

Coordinates are in modules; moduleSize only sets the width/height attributes, in unit. For print, pass the X-dimension in millimetres with unit = "mm". The text is not included: place QrCodeSymbol.humanReadable or QrCodeSymbol.text near the symbol if needed.

Parameters

lightColor

background colour, or null for a transparent background.