category |
Zend |
package |
Zend_Barcode |
copyright |
Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license |
New BSD License |
inherited_from |
\Zend_Barcode_Object_Ean13 |
Methods
Constructor
__construct(array|\Zend_Config $options = null
)
Inherited
Parameters
$options
array
\Zend_Config
Checking of parameters after all settings
checkParams() : boolean
Inherited
Complete drawing of the barcode
draw() : array
Inherited
Returns
array
Table of instructions
Retrieve background color of the image
getBackgroundColor() : integer
Inherited
Get height of the barcode bar
getBarHeight() : integer
Inherited
Get thickness of thick bar
getBarThickWidth() : integer
Inherited
Get thickness of thin bar
getBarThinWidth() : integer
Inherited
Retrieve barcode namespace
getBarcodeNamespace() : string
Inherited
Get barcode checksum
getChecksum(string $text) : integer
Inherited
Parameters
$text
string
Returns
integer
Retrieve if drawing of text to encode is enabled
getDrawText() : boolean
Inherited
Get factor applying to
thinBarWidth - thickBarWidth - barHeight - fontSize
getFactor() : integer
Inherited
Retrieve the font
getFont() : integer | string
Inherited
Retrieve the size of the font in case of TTF
getFontSize() : float
Inherited
Retrieve color of the barcode and text
getForeColor() : \unknown
Inherited
Get height of the result object
getHeight(boolean $recalculate = false
) : integer
Inherited
Parameters
$recalculate
boolean
Returns
integer
Retrieve the set of drawing instructions
getInstructions() : array
Inherited
Calculate the offset from the left of the object
if an orientation is activated
getOffsetLeft(boolean $recalculate = false
) : float
Inherited
Parameters
$recalculate
boolean
Returns
float
Calculate the offset from the top of the object
if an orientation is activated
getOffsetTop(boolean $recalculate = false
) : float
Inherited
Parameters
$recalculate
boolean
Returns
float
Retrieve orientation of barcode and text
getOrientation() : float
Inherited
Quiet zone before first bar
and after the last bar
getQuietZone() : integer
Inherited
Retrieve text to encode
getRawText() : string
Inherited
Retrieve if the adjustment of the position of the characters
to the position of the bars is enabled
getStretchText() : boolean
Inherited
Retrieve text to encode
getText() : string
Inherited
Retrieve text to display
getTextToDisplay() : string
Inherited
Retrieve type of barcode
getType() : string
Inherited
Get width of the result object
getWidth(boolean $recalculate = false
) : integer
Inherited
Parameters
$recalculate
boolean
Returns
integer
Retrieve if border are draw or not
getWithBorder() : boolean
Inherited
Retrieve if the checksum character is automatically
added to the barcode text
getWithChecksum() : boolean
Inherited
Retrieve if the checksum character is automatically
added to the barcode text
getWithChecksumInText() : boolean
Inherited
Retrieve if quiet zones are draw or not
getWithQuietZones() : boolean
Inherited
Set the color of the background
setBackgroundColor(integer $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
integer
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set height of the barcode bar
setBarHeight(integer $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
integer
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set thickness of thick bar
setBarThickWidth(integer $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
integer
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set thickness of thin bar
setBarThinWidth(integer $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
integer
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set the font for all instances of barcode
setBarcodeFont(string $font)
InheritedStatic
Set barcode namespace for autoloading
setBarcodeNamespace(string $namespace) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$namespace
string
Returns
\Zend_Barcode_Object_Upca
Set barcode state from config object
setConfig(\Zend_Config $config) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$config
\Zend_Config
Returns
\Zend_Barcode_Object_Upca
Activate/deactivate drawing of text to encode
setDrawText(boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
boolean
Returns
\Zend_Barcode_Object_Upca
Set factor applying to
thinBarWidth - thickBarWidth - barHeight - fontSize
setFactor(integer|float|string|boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
integer
float
string
boolean
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
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
setFont(integer|string $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
integer
string
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set the size of the font in case of TTF
setFontSize(float $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
float
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set color of the barcode and text
setForeColor(string $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
string
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set barcode state from options array
setOptions(array $options) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$options
array
Returns
\Zend_Barcode_Object_Upca
Set orientation of barcode and text
setOrientation(integer|float|string|boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
integer
float
string
boolean
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Allow fast inversion of font/bars color and background color
setReverseColor() : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Returns
\Zend_Barcode_Object_Upca
Activate/deactivate the adjustment of the position
of the characters to the position of the bars
setStretchText(boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
boolean
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Set text to encode
setText(string $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
string
Returns
\Zend_Barcode_Object_Upca
Activate/deactivate drawing of the bar
setWithBorder(boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
boolean
Returns
\Zend_Barcode_Object_Upca
Activate/deactivate the automatic generation
of the checksum character
added to the barcode text
setWithChecksum(boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
boolean
Returns
\Zend_Barcode_Object_Upca
Activate/deactivate the automatic generation
of the checksum character
added to the barcode text
setWithChecksumInText(boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
boolean
Exceptions
\Zend_Barcode_Object_Exception |
|
Returns
\Zend_Barcode_Object_Upca
Activate/deactivate drawing of the quiet zones
setWithQuietZones(boolean $value) : \Zend_Barcode_Object_Upca
Inherited
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$value
boolean
Returns
\Zend_Barcode_Object_Upca
Check for invalid characters
validateText(string $value)
Inherited
Parameters
$value
string
Text to be ckecked
Add an instruction in the array of instructions
_addInstruction(array $instruction)
Inherited
Parameters
$instruction
array
Automatically add leading zeros if barcode length is fixed
_addLeadingZeros(string $text, boolean $withoutChecksum = false
) : string
Inherited
Parameters
$text
string
$withoutChecksum
boolean
Returns
string
Add a polygon drawing instruction in the set of instructions
_addPolygon(array $points, integer $color = null
, boolean $filled = true
)
Inherited
Parameters
$points
array
$color
integer
$filled
boolean
Add a text drawing instruction in the set of instructions
_addText(string $text, float $size, array $position, string $font, integer $color, string $alignment = 'center'
, float|integer $orientation = 0
)
Inherited
Parameters
$text
string
$size
float
$position
array
$font
string
$color
integer
$alignment
string
$orientation
float
integer
Height of the barcode
_calculateBarcodeHeight() : integer
Inherited
Width of the barcode (in pixels)
_calculateBarcodeWidth() : integer
inherited_from |
\Zend_Barcode_Object_Ean13::_calculateBarcodeWidth() |
Returns
integer
Calculate the width of the barcode
_calculateBarcodeWidth() : integer
Inherited
Height of the result object
_calculateHeight() : integer
Inherited
Width of the result image (before any rotation)
_calculateWidth() : integer
Inherited
Drawing with an angle is just allow TTF font
_checkFontAndOrientation()
Inherited
Exceptions
\Zend_Barcode_Object_Exception |
|
Checking of parameters after all settings
_checkParams()
Inherited
Check the ratio between the thick and the thin bar
_checkRatio(integer $min = 2
, integer $max = 3
)
Inherited
Parameters
$min
integer
$max
integer
Exceptions
\Zend_Barcode_Object_Exception |
|
Check if a text is really provided to barcode
_checkText(string|null $value = null
)
Inherited
Parameters
$value
string
null
Exceptions
\Zend_Barcode_Object_Exception |
|
Draw the barcode
_drawBarcode()
Inherited
Partial function to draw border
_drawBorder()
Inherited
_drawEan13Text()
_drawEan13Text()
Inherited
Partial function to draw text
_drawText() : void
inherited_from |
\Zend_Barcode_Object_Ean13::_drawText() |
Partial function to draw text
_drawText()
Inherited
Default options for Postnet barcode
_getDefaultOptions() : void
inherited_from |
\Zend_Barcode_Object_Ean13::_getDefaultOptions() |
Set default options for particular object
_getDefaultOptions()
Inherited
Allow each child to draw something else
(ex: bearer bars in interleaved 2 of 5 code)
_postDrawBarcode()
Inherited
Allow each child to draw something else
_preDrawBarcode()
Inherited
Prepare array to draw barcode
_prepareBarcode() : array
inherited_from |
\Zend_Barcode_Object_Ean13::_prepareBarcode() |
Returns
array
Each child must prepare the barcode and return
a table like array(
0 => array(
0 => int (visible(black) or not(white))
1 => int (width of the bar)
2 => float (0->1 position from the top of the beginning of the bar in %)
3 => float (0->1 position from the top of the end of the bar in %)
),
1 => .
_prepareBarcode() : array
Inherited
Apply rotation on a point in X/Y dimensions
_rotate(float $x1, float $y1) : array
Inherited
Parameters
$x1
float
x-position before rotation
$y1
float
y-position before rotation
Returns
array
Array of two elements corresponding to the new XY point
Standard validation for most of barcode objects
_validateText(string $value, array $options = array()
)
Inherited
Parameters
$value
string
$options
array
Exceptions
\Zend_Barcode_Object_Exception |
|
Properties
Activate automatic addition of leading zeros
if barcode length is fixed
$_addLeadingZeros :
Background color of the object
$_backgroundColor : integer
Height of the bar
$_barHeight : integer
Width of a thick bar
$_barThickWidth : integer
Width of a thin bar
$_barThinWidth : integer
Fix barcode length (numeric or string like 'even')
$_barcodeLength :
Namespace of the barcode for autoloading
$_barcodeNamespace : string
Default
'Zend_Barcode_Object'
Coding map
- 0 = narrow bar
- 1 = wide bar
$_codingMap : array
Default
array('A' => array(0 => "0001101", 1 => "0011001", 2 => "0010011", 3 => "0111101", 4 => "0100011", 5 => "0110001", 6 => "0101111", 7 => "0111011", 8 => "0110111", 9 => "0001011"), 'B' => array(0 => "0100111", 1 => "0110011", 2 => "0011011", 3 => "0100001", 4 => "0011101", 5 => "0111001", 6 => "0000101", 7 => "0010001", 8 => "0001001", 9 => "0010111"), 'C' => array(0 => "1110010", 1 => "1100110", 2 => "1101100", 3 => "1000010", 4 => "1011100", 5 => "1001110", 6 => "1010000", 7 => "1000100", 8 => "1001000", 9 => "1110100"))
Display (or not) human readable text
$_drawText : boolean
Factor to multiply bar and font measure
(barHeight, barThinWidth, barThickWidth & fontSize)
$_factor : integer
Font resource
- integer (1 to 5): corresponds to GD included fonts
- string: corresponds to path of a TTF font
$_font : integer | string
Font size
$_fontSize : float
Font and bars color of the object
$_foreColor : integer
Height of the object
$_height : integer
Set of drawing instructions
$_instructions : array
Activation of mandatory checksum
to deactivate unauthorized modification
$_mandatoryChecksum :
Force quiet zones even if
$_mandatoryQuietZones : boolean
Offset from the left the object
(calculated from the orientation)
$_offsetLeft : integer
Offset from the top the object
(calculated from the orientation)
$_offsetTop : integer
Orientation of the barcode in degrees
$_orientation : float
$_parities
$_parities
Default
array(0 => array('A', 'A', 'A', 'A', 'A', 'A'), 1 => array('A', 'A', 'B', 'A', 'B', 'B'), 2 => array('A', 'A', 'B', 'B', 'A', 'B'), 3 => array('A', 'A', 'B', 'B', 'B', 'A'), 4 => array('A', 'B', 'A', 'A', 'B', 'B'), 5 => array('A', 'B', 'B', 'A', 'A', 'B'), 6 => array('A', 'B', 'B', 'B', 'A', 'A'), 7 => array('A', 'B', 'A', 'B', 'A', 'B'), 8 => array('A', 'B', 'A', 'B', 'B', 'A'), 9 => array('A', 'B', 'B', 'A', 'B', 'A'))
TTF font name: can be set before instanciation of the object
$_staticFont : string
Static
Adjust (or not) position of human readable characters with barcode
$_stretchText : boolean
Character used to substitute checksum character for validation
$_substituteChecksumCharacter :
Text to display
$_text : string
Barcode type
$_type : string
Width of the object
$_width : integer
Activate/deactivate border of the object
$_withBorder : boolean
Drawing of checksum
$_withChecksum : boolean
Drawing of checksum inside text
$_withChecksumInText : boolean
Activate/deactivate drawing of quiet zones
$_withQuietZones : boolean