Skip to content

Barcode

util.barcode : object

Barcode image generation functions.

Kind: static namespace of util

barcode.getBuffer(data, [type], [height], [scale], [includetext]) ⇒ Promise.<Buffer>

Get a PNG image buffer of a barcode. Uses library "bwip-js".

Kind: static method of barcode
Returns: Promise.<Buffer> - PNG data for the barcode.

Param Type Default Description
data string
[type] string "\"code128\""
[height] number 10
[scale] number 2
[includetext] boolean false Set true to render the barcode's content as text below the code.

barcode.getBase64(data, [type], [height], [scale], [includetext]) ⇒ Promise.<string>

Get a PNG image of a barcode as a base64 data URI. Uses library "bwip-js".

Kind: static method of barcode
Returns: Promise.<string> - "data:image/png;base64,..."

Param Type Default Description
data string
[type] string "\"code128\""
[height] number 10
[scale] number 2
[includetext] boolean false Set true to render the barcode's content as text below the code.