Code Result
<?php
require_once('BCGColor.php');
require_once('BCGDrawing.php');
require_once('BCGdatabarexpanded.barcode.php');
$colorfg = new BCGColor(0, 0, 0);
$colorbg = new BCGColor(255, 255, 255);
// Barcode part Part
$code = new BCGdatabarexpanded();
$code->setScale(1);
$code->setStacked(1);
$code->setLinkageFlag(false);
$code->setColor($colorfg, $colorbg);
$code->parse('240HELLO');
// Drawing Part
$drawing = new BCGDrawing('', $colorbg);
$drawing->setBarcode($code);
$drawing->draw();
header('Content-Type: image/png');
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
?>