PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Common Options

In the following list, the values have no unit; we will use the term "unit." For example, the default value of the "thin bar" is "1 unit." The real units depend on the rendering support. The individual setters are obtained by uppercasing the initial letter of the option and prefixing the name with "set" (e.g. "barHeight" => "setBarHeight"). All options have a correspondant getter prefixed with "get" (e.g. "getBarHeight"). Available options are:

Table 17. Common Options

Option Data Type Default Value Description
rendererNamespace String Zend_Barcode_Renderer Namespace of the renderer; for example, if you need to extend the renderers
horizontalPosition String "left" Can be "left", "center" or "right". Can be useful with PDF or if the setWidth() method is used with an image renderer.
verticalPosition String "top" Can be "top", "middle" or "bottom". Can be useful with PDF or if the setHeight() method is used with an image renderer.
leftOffset Integer 0 Top position of the barcode inside the renderer. If used, this value will override the "horizontalPosition" option.
topOffset Integer 0 Top position of the barcode inside the renderer. If used, this value will override the "verticalPosition" option.
automaticRenderError Boolean TRUE Whether or not to automatically render errors. If an exception occurs, the provided barcode object will be replaced with an Error representation. Note that some errors (or exceptions) can not be rendered.
moduleSize Float 1 Size of a rendering module in the support.
barcode Zend_Barcode_Object NULL The barcode object to render.

An additional getter exists: getType(). It returns the name of the renderer class without the namespace (e.g. Zend_Barcode_Renderer_Image returns "image").

Zend Framework