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) : void
Add an instruction in the array of instructions
ParametersName | Type | Description |
---|
$instruction | array | |
---|
_addLeadingZeros(string $text, boolean $withoutChecksum = false) : void
Automatically add leading zeros if barcode length is fixed
ParametersName | Type | Description |
---|
$text | string | |
---|
$withoutChecksum | boolean | |
---|
_addPolygon(array $points, integer $color = null, boolean $filled = true) : void
Add a polygon drawing instruction in the set of instructions
ParametersName | 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) : void
Add a text drawing instruction in the set of instructions
ParametersName | Type | Description |
---|
$text | string | |
---|
$size | float | |
---|
$position | array | |
---|
$font | string | |
---|
$color | integer | |
---|
$alignment | string | |
---|
$orientation | float | |
---|
_checkRatio(integer $min = 2, integer $max = 3) : void
Check the ratio between the thick and the thin bar
ParametersName | Type | Description |
---|
$min | integer | |
---|
$max | integer | |
---|
Details- Throw
-
_checkText( $value = null) : void
Check if a text is really provided to barcode
ParametersName | Type | Description |
---|
$value | | |
---|
Details- Throw
-
_rotate(float $x1, float $y1) : array
Apply rotation on a point in X/Y dimensions
ParametersName | Type | Description |
---|
$x1 | float | x-position before rotation |
---|
$y1 | float | y-position before rotation |
---|
ReturnsType | Description |
---|
array | Array of two elements corresponding to the new XY point |
_validateText(string $value, array $options = array()) : void
Standard validation for most of barcode objects
ParametersName | Type | Description |
---|
$value | string | |
---|
$options | array | |
---|
draw() : array
Complete drawing of the barcode
ReturnsType | Description |
---|
array | Table of instructions |
getHeight( $recalculate = false) : integer
Get height of the result object
ParametersName | Type | Description |
---|
$recalculate | | |
---|
Returns getOffsetLeft(boolean $recalculate = false) : float
Calculate the offset from the left of the object
if an orientation is activated
ParametersName | Type | Description |
---|
$recalculate | boolean | |
---|
Returns getOffsetTop(boolean $recalculate = false) : float
Calculate the offset from the top of the object
if an orientation is activated
ParametersName | Type | Description |
---|
$recalculate | boolean | |
---|
Returns getWidth( $recalculate = false) : integer
Get width of the result object
ParametersName | Type | Description |
---|
$recalculate | | |
---|
Returns setBackgroundColor(integer $value) : \Zend_Barcode_Object
Set the color of the background
ParametersName | Type | Description |
---|
$value | integer | |
---|
ReturnsDetails- Throw
-
setBarHeight(integer $value) : \Zend_Barcode_Object
Set height of the barcode bar
ParametersName | Type | Description |
---|
$value | integer | |
---|
ReturnsDetails- Throw
-
setBarThickWidth(integer $value) : \Zend_Barcode_Object
Set thickness of thick bar
ParametersName | Type | Description |
---|
$value | integer | |
---|
ReturnsDetails- Throw
-
setBarThinWidth(integer $value) : \Zend_Barcode_Object
Set thickness of thin bar
ParametersName | Type | Description |
---|
$value | integer | |
---|
ReturnsDetails- Throw
-
setBarcodeFont(string $font) : void
staticSet the font for all instances of barcode
ParametersName | Type | Description |
---|
$font | string | |
---|
setBarcodeNamespace(string $namespace) : \Zend_Barcode_Object
Set barcode namespace for autoloading
ParametersName | Type | Description |
---|
$namespace | string | |
---|
Returns setDrawText(boolean $value) : \Zend_Barcode_Object
Activate/deactivate drawing of text to encode
ParametersName | Type | Description |
---|
$value | boolean | |
---|
Returns setFactor(float $value) : \Zend_Barcode_Object
Set factor applying to
thinBarWidth - thickBarWidth - barHeight - fontSize
ParametersName | Type | Description |
---|
$value | float | |
---|
ReturnsDetails- Throw
-
setFont(integer | string $value) : \Zend_Barcode_Object
Set 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
ParametersName | Type | Description |
---|
$value | integer | string | |
---|
ReturnsDetails- Throw
-
setFontSize(float $value) : \Zend_Barcode_Object
Set the size of the font in case of TTF
ParametersName | Type | Description |
---|
$value | float | |
---|
ReturnsDetails- Throw
-
setForeColor(string $value) : \Zend_Barcode_Object
Set color of the barcode and text
ParametersName | Type | Description |
---|
$value | string | |
---|
ReturnsDetails- Throw
-
setOptions(array $options) : \Zend_Barcode_Object
Set barcode state from options array
ParametersName | Type | Description |
---|
$options | array | |
---|
Returns setOrientation(float $value) : \Zend_Barcode_Object
Set orientation of barcode and text
ParametersName | Type | Description |
---|
$value | float | |
---|
ReturnsDetails- Throw
-
setStretchText(boolean $value) : \Zend_Barcode_Object
Activate/deactivate the adjustment of the position
of the characters to the position of the bars
ParametersName | Type | Description |
---|
$value | boolean | |
---|
ReturnsDetails- Throw
-
setWithBorder(boolean $value) : \Zend_Barcode_Object
Activate/deactivate drawing of the bar
ParametersName | Type | Description |
---|
$value | boolean | |
---|
Returns setWithChecksum(boolean $value) : \Zend_Barcode_Object
Activate/deactivate the automatic generation
of the checksum character
added to the barcode text
ParametersName | Type | Description |
---|
$value | boolean | |
---|
Returns setWithChecksumInText(boolean $value) : \Zend_Barcode_Object
Activate/deactivate the automatic generation
of the checksum character
added to the barcode text
ParametersName | Type | Description |
---|
$value | boolean | |
---|
ReturnsDetails- Throw
-
setWithQuietZones(boolean $value) : \Zend_Barcode_Object
Activate/deactivate drawing of the quiet zones
ParametersName | Type | Description |
---|
$value | boolean | |
---|
Returns validateText(string $value) : void
Check for invalid characters
ParametersName | Type | Description |
---|
$value | string | Text to be ckecked |
---|