-
Notifications
You must be signed in to change notification settings - Fork 409
Open
Description
I'm having a bit of trouble generating Code 128 B barcodes and I'm fairly lost as to why. I've written a short script that demonstrates the problem.
require 'vendor/autoload.php';
$code = '1GVRM3I09Z56';
//OLD Method
$generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
$barcode = $generator->getBarcode($code, $generator::TYPE_CODE_128);
file_put_contents('goodbarcode.png', $barcode);
//NEW Method
$barcode = (new \Picqer\Barcode\Types\TypeCode128())->getBarcode($code);
$barcodeRenderer = new \Picqer\Barcode\Renderers\PngRenderer();
file_put_contents('failedbarcode.png', $barcodeRenderer->render($barcode));
The old method generates a working barcode that scans correctly. Here's the file it generated:
And the newer method, assuming I'm doing it correct, generates a barcode that can't be scanned:
Any idea what's going on?
Note: when I only use numbers in $code, there are no issues. I tried forcing TypeCode128B() but this did not resolve the issue.
Metadata
Metadata
Assignees
Labels
No labels

