Home page > Blog > Zend_Barcode - part 1 : using
Sunday 20 December 2009, by
All the versions of this article: [English] [français]
Zend Framework 1.10 will integrate Zend_Barcode initially called Zend_Image_Barcode in the proposals.
The main difference between this first proposition and Zend_Barcode, it’s the separation between Objects and Renderers. This allowed to write an image generator (Zend_Barcode_Renderer_Image) and a PDF generator (Zend_Barcode_Renderer_Pdf).
This component internally uses a new version of Zend_Validate_Barcode specially rewritten for 1.10 by Thomas (http://www.thomasweidner.com/flatpr...).
The official documentation will of course integrate the examples showing how to use the component but here is some use cases.
You can put at the root of your Web server:
This will of course give you an image of error:
![]()
Because no text is provided.
You obtain it by simply adding the ’text’ parameter:
You have your first barcode in 5 lines of code:

If you use the image renderer (based on GD extension) and if you don’t specify a TTF font, the built-in fonts will be used. You can set your own font in the options of the barcode or by global definition:
You will obtain:

2 Forum messages