picqer/php-barcode-generator

Image not showing when used text and number, but also showing number.

Closed this issue · 5 comments

Hello

Image not showing when used text and number like (W2334RR12), but also showing number like (6432165412).

Here my code::
ob_clean(); require 'vendor/autoload.php'; use Picqer\Barcode\BarcodeGeneratorPNG; $text = $_GET['text']; $price = $_GET['price']; $generator = new BarcodeGeneratorPNG(); $barcodeImage = $generator->getBarcode($text, $generator::TYPE_CODE_128_C,2,64); header('Content-Type: image/png'); print $barcodeImage;

I am also encode text to base64_encode but also not showing.

Please help

If you use TYPE_CODE_128_C specifically, so version "C", it does not support all characters. See https://barcodewiz.com/activex-control/user-manual/symbologies/code-128-a-b-c-and-auto

If you only use TYPE_CODE_128, it will automatically switch between versions A, B and C to get you all the chars you need.