picqer / php-barcode-generator

Barcode generator in PHP that is easy to use, non-bloated and framework independent.
GNU Lesser General Public License v3.0
1.67k stars 402 forks source link

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

Closed obaidul99 closed 1 year ago

obaidul99 commented 1 year ago

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;

obaidul99 commented 1 year ago

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

obaidul99 commented 1 year ago

Screenshot_1

obaidul99 commented 1 year ago

Screenshot_3

obaidul99 commented 1 year ago

Please help

casperbakker commented 1 year ago

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.