I´m using PHP class Barcode-Coder (http://barcode-coder.com) to generate a code128 barcode as a GIF. It works fine and the scanner can read it. However the area where I want to print the barcode is to small for the image and if I just scale the image down the scan fails (logically). Is there a way to set the width of the bars, currently is seems like it uses two pixels and that makes it to wide for my print area.
In the example/docs there is a online genereator that generates a barcorde with thinner bars but I can´t find the setting for this.
The code I'm currently using
$code = isset($_GET["message"]) ? $_GET["message"] : "";
// Settings for barcode
$marge = 0; // between barcode and hri in pixel
$x = 100; // barcode center
$y = 15; // barcode center
$height = 30; // barcode height in 1D ; module size in 2D
$width = 2; // barcode height in 1D ; not use in 2D
$angle = 0; // rotation in degrees : nb : non horizontable barcode might not be usable because of pixelisation
$type = 'code128';
// ALLOCATE GD RESSOURCE
$im = imagecreatetruecolor(200, 30);
$black = ImageColorAllocate($im,0x00,0x00,0x00);
$white = ImageColorAllocate($im,0xff,0xff,0xff);
imagefilledrectangle($im, 0, 0, 200, 30, $white);
// Create barcode
$data = Barcode::gd($im, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);
// Generate image with barcode
header('Content-type: image/gif');
imagegif($im);
imagedestroy($im);
And no, sadly it is not as simple as just setting $width from 2 to 1. That is just the spacing between the bars, not the bars itselfs, i think.
Any help is much appreciated.