Databar Expanded - Demonstration

Encode this text

* For this demo, no more than 30 characters allowed
Configurations
  • Scale
    * For this demo, the value is 1
  • Stacked
    * For this demo, you can only set 1 to 2
  • Linkage flag
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);
?>