Demonstration - Databar Expanded
Generally used for coupons and variable weight items.
Can encode a fixed amount of data.
Data input must follow the GS1 Standard; SSC identifier must be registered.
Contains Expanded and Expanded Stacked versions.
'use strict';
import { createServer } from 'http';
import { BCGColor, BCGDrawing, BCGFont, BCGLabel } from '@barcode-bakery/barcode-common';
import { BCGdatabarexpanded } from '@barcode-bakery/barcode-databarexpanded';
http.createServer(function (request, response) {
let font = new BCGFont('Arial', 18);
let colorBlack = new BCGColor(0, 0, 0);
let colorWhite = new BCGColor(255, 255, 255);
// Barcode Part
let code = new BCGdatabarexpanded();
code.setScale(2); // Resolution
code.setThickness(30); // Thickness
code.setForegroundColor(colorBlack); // Color of bars
code.setBackgroundColor(colorWhite); // Color of spaces
code.setFont(font); // Font
code.parse('240HELLO');
// Drawing Part
var drawing = new BCGDrawing(code, colorWhite);
drawing.toBuffer(BCGDrawing.ImageFormat.Png, function (err, buffer) {
response.writeHead(200, { "Content-Type": "image/png" });
response.end(buffer);
});
}).listen(8124);