encode

fun encode(text: String, errorCorrection: QrErrorCorrection = QrErrorCorrection.M, version: Int? = null, mask: Int? = null): QrCodeSymbol(source)

Encodes text in the smallest version that fits, or in exactly version when given.

Parameters

mask

mask pattern 0-7, or null to choose the one with the lowest penalty (recommended).

Throws

with Gs1ErrorCode.QR_CODE_TOO_LONG if the text does not fit.