PHP class to generate barcode in Code39 standard with height and width adjustment

Asked

Viewed 5,122 times

0

I’m having difficulty generating barcodes in PHP, by default code39, containing 10 digits (numbers only), for printing the web page containing the barcode in thermal printers.

I have tested several classes, but have error in optical reading.

Could someone indicate a good PHP class to generate barcode in the default code39 and allowing the height and width of the barcode to be adjusted?

Preferably, something that can be used as follows:

<img src="/barcode.php?code=' . $cod_barras . '&largura=180&altura=80" />

Important: I need it to work without any dependency other than PHP and the library GD.

Thanks in advance for any help!

  • 1

    I usually use one, but it’s for Laravel 4 and 5. It’s called Milon Barcode.

  • Thanks for your attention, but I need it to work without any dependency beyond the GD library.

  • Can you install where? I use packagist. There you find anything for php

  • 2

    Buddy, look at this https://github.com/picqer/php-barcode-generator

  • Wallace Maxters: php-Barcode-Enerator got wider than the coil of the thermal printer... so when it resizes to smaller width it gets poor quality.

  • No way to configure lib resolution?

  • I lowered the resolution to 1px. In the inkjet printer is good, but in the thermal (Elgin i9) the lines come out a little "dotted". Trying several times the reader can even read, but it is not the ideal.

Show 2 more comments

1 answer

0


After trying several classes, I found one that met well with barcode printing, with 10 digits, in the Code39 standard, in thermal printers, without giving reading problems or something similar.

Barcode Generator: Web interface to generate Barcode images

Despite being a class whose last update was on 09/08/2005, it worked very well for me.

I hope it helps if someone goes through the same situation I went through.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.