Skip to main content

Function: encodeQr()

function encodeQr(value, errorCorrectionLevel): QrMatrix;

Defined in: encode.ts:48

Encodes value (UTF-8; numeric and alphanumeric runs are packed more densely) into the smallest QR symbol for errorCorrectionLevel.

The error correction level is then raised as far as it goes without making the symbol bigger: same size, more redundancy, so a logo or damage is tolerated better at no cost. QrMatrix.errorCorrectionLevel reports the level used.

Throws a RangeError when value doesn't fit into a QR code at the requested level.

Parameters​

ParameterType
valuestring
errorCorrectionLevelErrorCorrectionLevel

Returns​

QrMatrix