php-barcode-generator icon indicating copy to clipboard operation
php-barcode-generator copied to clipboard

Add background and margin on generated barcode

Open osflake opened this issue 1 year ago • 0 comments

Hello Mr @casperbakker,

I have one suggestions, because when I used Your library (very very thanks for that) we found a very big problem in our 1D scanner.

When we present barcode in dark mode (night mode) web browser change background to dark and outer lines are not readable. image

It is possible to add param like:

$generator->setMargin(10);

$generator = new Picqer\Barcode\BarcodeGeneratorJPG();
$generator->useGd();
$generator->setMargin(10);
$result = $generator->getBarcode($inputValue, $generator::TYPE_CODE_128, 4, 120, $color = array(0, 0, 0));    
header('Content-Type: image/png');
echo $result;

or

$setMargin = 10;
$result = $generator->getBarcode($inputValue, $generator::TYPE_CODE_128, 4, 120, $color = array(0, 0, 0),$setMargin); 

Its very important issue.

Thank You

osflake avatar May 23 '24 17:05 osflake