Published
Edited
Feb 25, 2019
Importers
Insert cell
Insert cell
Insert cell
function getBarcodeDataURI(options) {

return new Promise((resolve, reject) => {
let canvas = document.createElement('canvas')

bwipjs(canvas, options, function(err, cvs) {
if (err) {
reject(err)
} else {
// Don't need the second param since we have the canvas in scope...
resolve(cvs.toDataURL('image/png'))
}
})
})
}

Insert cell
a = await getBarcodeDataURI({
bcid: 'ean8', // Barcode type
text: '1234567', // Text to encode
scale: 1, // 3x scaling factor
height: 23, // Bar height, in millimeters
})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more