Skip to content

script.qrcode ​

Creates a QR code as a PNG image.

js
script.qrcode(inputStr, size)

Parameters ​

ParameterTypeDescription
inputStrstringThe data to encode.
sizenumberThe width and height of the image, in pixels.

Returns ​

string

The image, base64-encoded, or "" if it couldn't be created.

Examples ​

js
const base64Image = script.qrcode("Data to encode", 300);