Démonstration - Aztec

Capable de contenir un grand nombre de données dans une variété de caractères.
Peut être utilisé soit en version Compact ou Full.
Support l'utilisation d'Extended Channel Interpretation (ECI).
* 30 caractères maximum pour cette démo.
'use strict';

import { createServer } from 'http';
import { BCGColor, BCGDrawing } from '@barcode-bakery/barcode-common';
import { BCGaztec } from '@barcode-bakery/barcode-aztec';

http.createServer(function (request, response) {
    var colorBlack = new BCGColor(0, 0, 0);
    var colorWhite = new BCGColor(255, 255, 255);

    // Barcode Part
    var code = new BCGaztec();
    code.setScale(2); // Resolution
    code.setForegroundColor(colorBlack); // Color of bars
    code.setBackgroundColor(colorWhite); // Color of spaces
    code.parse('Aztec');

    // 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);