Demonstration - DataMatrix

Capable of being read by most mobile phones.
Generally used to label and track small items for inventory.
Has a very low error rate with internal error correction.
Barcode can be square or rectangular in shape.
* 30 character limit for this demo.

<?php
use BarcodeBakery\Common\BCGColor;
use BarcodeBakery\Common\BCGDrawing;
use BarcodeBakery\Barcode\BCGdatamatrix;

$colorFront = new BCGColor(0, 0, 0);
$colorBack = new BCGColor(255, 255, 255);

// Barcode Part
$code = new BCGdatamatrix();
$code->setScale(3);
$code->setForegroundColor($colorFront);
$code->setBackgroundColor($colorBack);
$code->parse('Datamatrix');

// Drawing Part
$drawing = new BCGDrawing('', $colorBack);
$drawing->setBarcode($code);
$drawing->draw();

header('Content-Type: image/png');

$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
?>