script.qrcode
Creates a QR code as a PNG image.
js
script.qrcode(inputStr, size)Parameters
| Parameter | Type | Description |
|---|---|---|
inputStr | string | The data to encode. |
size | number | The width and height of the image, in pixels. |
Returns
stringThe image, base64-encoded, or "" if it couldn't be created.
Examples
js
const base64Image = script.qrcode("Data to encode", 300);