OptionalbackgroundBackground colour as [r, g, b], each channel 0-255. Missing channels default to 255, so the default colour is white.
OptionalecError-correction level, used by 'qr' only (default 'M'). Other types ignore it.
OptionalfitTarget height in pixels for the symbol plus quiet zone; any showText caption is drawn below it. Applied like fitWidth; when both are set the smaller module size wins.
OptionalfitTarget width in pixels for the symbol plus quiet zone, a positive finite number. The module size becomes the largest whole number at which they fit, never below 1, so a too-small bound is exceeded; it replaces moduleSize.
OptionalforegroundForeground colour as [r, g, b], each channel 0-255. Missing channels default to 0, so the default colour is black.
OptionalmodulePixels per module, a positive integer. Default 4.
Optional Experimentalpdf417PDF417 output is not ISO/IEC 15438 conformant. Data columns 1-30 for 'pdf417' (default 4; values are truncated and clamped to the range; a non-finite value throws a RangeError).
Optional Experimentalpdf417PDF417 output is not ISO/IEC 15438 conformant. Error-correction level 0-8 for 'pdf417' (default 2; values are truncated and clamped to the range; a non-finite value throws a RangeError).
OptionalquietQuiet zone around the symbol, in modules, a non-negative integer. Default 4.
OptionalshowDraw textValue as a caption below the symbol. Default false. The caption is skipped when textValue is empty.
OptionaltextCaption text, drawn in a built-in 5x7 pixel font (letters are upper-cased; characters the font lacks render as a space). Default: empty, so no caption.
The symbology to encode.
Options for generateBarcode: the RenderOptions plus the symbology and sizing.
generateBarcodediffers from renderBarcodePNG in two defaults:quietZoneis4modules for'qr'and'datamatrix'and10for every other type, andtextValueis the encoded value.