PHP: Adjust output size of the barcode using Zend_Barcode | Magento Invoice Barcodes

PuLs33

New Member
I'm using the Zend_Barcode framework to generate barcodes for the first time in Magento with the intention of adding shipping barcodes to invoices.The model appears to be fairly simple but I cannot change the size of the barcode.If I sue this method:\[code\]$barcodeOptions = array('text' => 'ZEND-FRAMEWORK', 'width'=>400);$rendererOptions = array('width'=> 400);$renderer = Zend_Barcode::factory( 'code128', 'image', $barcodeOptions, $rendererOptions)->render();\[/code\]I end up with a BARCODE that's 275px but an IMAGE that's 400px wide. i.e. The actual visible barcode is the same size as if no options are sent, but the actual image size is 400px.Same if I use the draw method.\[code\]$barcodeOptions = array('text' => $barCodeNo, 'width'=> '400', 'height'=> '500'); $rendererOptions = array('width'=> '400', 'height'=> '500'); // Draw the barcode in a new image, $imageResource = Zend_Barcode::draw( 'code128', 'image', $barcodeOptions, $rendererOptions ); imagejpeg($imageResource);\[/code\]I can't find anything in the documentation apart from adding the size height and width into the options arrays, so what am I missing?Any help would be appreciated.
 
Back
Top