Barcode/Object/ObjectAbstract.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Barcode
- Subpackage
- Object
- Version
- $Id$
\Zend_Barcode_Object_ObjectAbstract
Package: Zend_BarcodeClass for generate Barcode
- Children
- \Zend_Barcode_Object_Code25
- \Zend_Barcode_Object_Code39
- \Zend_Barcode_Object_Error
- \Zend_Barcode_Object_Postnet
- \Zend_Barcode_Object_Code128
- \Zend_Barcode_Object_Royalmail
- \Zend_Barcode_Object_Ean13
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
Methods



_addInstruction(array $instruction) : voidAdd an instruction in the array of instructions
Parameters| Name | Type | Description |
|---|
| $instruction | array | |
|---|



_addLeadingZeros(string $text, boolean $withoutChecksum = false) : voidAutomatically add leading zeros if barcode length is fixed
Parameters| Name | Type | Description |
|---|
| $text | string | |
|---|
| $withoutChecksum | boolean | |
|---|



_addPolygon(array $points, integer $color = null, boolean $filled = true) : voidAdd a polygon drawing instruction in the set of instructions
Parameters| Name | Type | Description |
|---|
| $points | array | |
|---|
| $color | integer | |
|---|
| $filled | boolean | |
|---|



_addText(string $text, float $size, array $position, string $font, integer $color, string $alignment = 'center', float $orientation = 0) : voidAdd a text drawing instruction in the set of instructions
Parameters| Name | Type | Description |
|---|
| $text | string | |
|---|
| $size | float | |
|---|
| $position | array | |
|---|
| $font | string | |
|---|
| $color | integer | |
|---|
| $alignment | string | |
|---|
| $orientation | float | |
|---|



_checkRatio(integer $min = 2, integer $max = 3) : voidCheck the ratio between the thick and the thin bar
Parameters| Name | Type | Description |
|---|
| $min | integer | |
|---|
| $max | integer | |
|---|
Details- Throw
-



_checkText( $value = null) : voidCheck if a text is really provided to barcode
Parameters| Name | Type | Description |
|---|
| $value | | |
|---|
Details- Throw
-



_rotate(float $x1, float $y1) : arrayApply rotation on a point in X/Y dimensions
Parameters| Name | Type | Description |
|---|
| $x1 | float | x-position before rotation |
|---|
| $y1 | float | y-position before rotation |
|---|
Returns| Type | Description |
|---|
| array | Array of two elements corresponding to the new XY point |



_validateText(string $value, array $options = array()) : voidStandard validation for most of barcode objects
Parameters| Name | Type | Description |
|---|
| $value | string | |
|---|
| $options | array | |
|---|



draw() : arrayComplete drawing of the barcode
Returns| Type | Description |
|---|
| array | Table of instructions |



getHeight( $recalculate = false) : integerGet height of the result object
Parameters| Name | Type | Description |
|---|
| $recalculate | | |
|---|
Returns 


getOffsetLeft(boolean $recalculate = false) : floatCalculate the offset from the left of the object
if an orientation is activated
Parameters| Name | Type | Description |
|---|
| $recalculate | boolean | |
|---|
Returns 


getOffsetTop(boolean $recalculate = false) : floatCalculate the offset from the top of the object
if an orientation is activated
Parameters| Name | Type | Description |
|---|
| $recalculate | boolean | |
|---|
Returns 


getWidth( $recalculate = false) : integerGet width of the result object
Parameters| Name | Type | Description |
|---|
| $recalculate | | |
|---|
Returns 


setBackgroundColor(integer $value) : \Zend_Barcode_ObjectSet the color of the background
Parameters| Name | Type | Description |
|---|
| $value | integer | |
|---|
ReturnsDetails- Throw
-



setBarHeight(integer $value) : \Zend_Barcode_ObjectSet height of the barcode bar
Parameters| Name | Type | Description |
|---|
| $value | integer | |
|---|
ReturnsDetails- Throw
-



setBarThickWidth(integer $value) : \Zend_Barcode_ObjectSet thickness of thick bar
Parameters| Name | Type | Description |
|---|
| $value | integer | |
|---|
ReturnsDetails- Throw
-



setBarThinWidth(integer $value) : \Zend_Barcode_ObjectSet thickness of thin bar
Parameters| Name | Type | Description |
|---|
| $value | integer | |
|---|
ReturnsDetails- Throw
-



setBarcodeFont(string $font) : voidstaticSet the font for all instances of barcode
Parameters| Name | Type | Description |
|---|
| $font | string | |
|---|



setBarcodeNamespace(string $namespace) : \Zend_Barcode_ObjectSet barcode namespace for autoloading
Parameters| Name | Type | Description |
|---|
| $namespace | string | |
|---|
Returns 


setDrawText(boolean $value) : \Zend_Barcode_ObjectActivate/deactivate drawing of text to encode
Parameters| Name | Type | Description |
|---|
| $value | boolean | |
|---|
Returns 


setFactor(float $value) : \Zend_Barcode_ObjectSet factor applying to
thinBarWidth - thickBarWidth - barHeight - fontSize
Parameters| Name | Type | Description |
|---|
| $value | float | |
|---|
ReturnsDetails- Throw
-



setFont(integer | string $value) : \Zend_Barcode_ObjectSet the font:
- if integer between 1 and 5, use gd built-in fonts
- if string, $value is assumed to be the path to a TTF font
Parameters| Name | Type | Description |
|---|
| $value | integer | string | |
|---|
ReturnsDetails- Throw
-



setFontSize(float $value) : \Zend_Barcode_ObjectSet the size of the font in case of TTF
Parameters| Name | Type | Description |
|---|
| $value | float | |
|---|
ReturnsDetails- Throw
-



setForeColor(string $value) : \Zend_Barcode_ObjectSet color of the barcode and text
Parameters| Name | Type | Description |
|---|
| $value | string | |
|---|
ReturnsDetails- Throw
-



setOptions(array $options) : \Zend_Barcode_ObjectSet barcode state from options array
Parameters| Name | Type | Description |
|---|
| $options | array | |
|---|
Returns 


setOrientation(float $value) : \Zend_Barcode_ObjectSet orientation of barcode and text
Parameters| Name | Type | Description |
|---|
| $value | float | |
|---|
ReturnsDetails- Throw
-



setStretchText(boolean $value) : \Zend_Barcode_ObjectActivate/deactivate the adjustment of the position
of the characters to the position of the bars
Parameters| Name | Type | Description |
|---|
| $value | boolean | |
|---|
ReturnsDetails- Throw
-



setWithBorder(boolean $value) : \Zend_Barcode_ObjectActivate/deactivate drawing of the bar
Parameters| Name | Type | Description |
|---|
| $value | boolean | |
|---|
Returns 


setWithChecksum(boolean $value) : \Zend_Barcode_ObjectActivate/deactivate the automatic generation
of the checksum character
added to the barcode text
Parameters| Name | Type | Description |
|---|
| $value | boolean | |
|---|
Returns 


setWithChecksumInText(boolean $value) : \Zend_Barcode_ObjectActivate/deactivate the automatic generation
of the checksum character
added to the barcode text
Parameters| Name | Type | Description |
|---|
| $value | boolean | |
|---|
ReturnsDetails- Throw
-



setWithQuietZones(boolean $value) : \Zend_Barcode_ObjectActivate/deactivate drawing of the quiet zones
Parameters| Name | Type | Description |
|---|
| $value | boolean | |
|---|
Returns 


validateText(string $value) : voidCheck for invalid characters
Parameters| Name | Type | Description |
|---|
| $value | string | Text to be ckecked |
|---|