2
我正在使用Zend_Barcode框架在Magento中第一次生成条形码,目的是向发票添加运输条形码。PHP:使用Zend_Barcode调整条码的输出大小| Magento发票条码
该模型看起来相当简单,但我无法更改条形码的大小。
如果我起诉这个方法:
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK', 'width'=>400);
$rendererOptions = array('width'=> 400);
$renderer = Zend_Barcode::factory(
'code128', 'image', $barcodeOptions, $rendererOptions
)->render();
我结束了条形码那是275px,但图像这是400像素宽。即实际可见的条形码尺寸与没有选项发送时相同,但实际图像尺寸为400px。
同样如果我使用绘制方法。
$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);
我找不到文档中的任何东西除了增加大小的高度和宽度为选项数组,所以我缺少什么?
任何帮助,将不胜感激。
以及如何调整字体大小?由于条形码图形增加,但不是下面的文字。谢谢 – Enrique 2015-06-30 00:55:13