Barcode objects allow you to generate barcodes independently of the rendering support. After generation, you can retrieve the barcode as an array of drawing instructions that you can provide to a renderer.
Objects have a large number of options. Most of them are common to all objects. These options can be set in four ways:
As an array or a
Zend_Configobject passed to the constructor.As an array passed to the
setOptions()method.As a
Zend_Configobject passed to thesetConfig()method.Via individual setters for each configuration type.
Example 64. Different ways to parameterize a barcode object
<?php
$options = array('text' => 'ZEND-FRAMEWORK', 'barHeight' => 40);
// Case 1: constructor
$barcode = new Zend_Barcode_Object_Code39($options);
// Case 2: setOptions()
$barcode = new Zend_Barcode_Object_Code39();
$barcode->setOptions($options);
// Case 3: setConfig()
$config = new Zend_Config($options);
$barcode = new Zend_Barcode_Object_Code39();
$barcode->setConfig($config);
// Case 4: individual setters
$barcode = new Zend_Barcode_Object_Code39();
$barcode->setText('ZEND-FRAMEWORK')
->setBarHeight(40);




