package |
Default |
inherited_from |
\Zend\Barcode\Object\AbstractObject |
Methods
Constructor
__construct(array|\Traversable $options = null
)
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::__construct() |
Parameters
$options
array
\Traversable
Checking of parameters after all settings
checkParams() : boolean
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::checkParams() |
Returns
boolean
Complete drawing of the barcode
draw() : array
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::draw() |
Returns
array
Table of instructions
Retrieve background color of the image
getBackgroundColor() : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getBackgroundColor() |
Returns
integer
Get height of the barcode bar
getBarHeight() : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getBarHeight() |
Returns
integer
Get thickness of thick bar
getBarThickWidth() : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getBarThickWidth() |
Returns
integer
Get thickness of thin bar
getBarThinWidth() : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getBarThinWidth() |
Returns
integer
Retrieve barcode namespace
getBarcodeNamespace() : string
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getBarcodeNamespace() |
Returns
string
Retrieve if drawing of text to encode is enabled
getDrawText() : boolean
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getDrawText() |
Returns
boolean
Get factor applying to
thinBarWidth - thickBarWidth - barHeight - fontSize
getFactor() : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getFactor() |
Returns
integer
Retrieve the font
getFont() : integer | string
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getFont() |
Returns
integer
string
Retrieve the size of the font in case of TTF
getFontSize() : float
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getFontSize() |
Returns
float
Retrieve color of the barcode and text
getForeColor() : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getForeColor() |
Returns
integer
Get height of the result object
getHeight(boolean $recalculate = false
) : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getHeight() |
Parameters
$recalculate
boolean
Returns
integer
Retrieve the set of drawing instructions
getInstructions() : array
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getInstructions() |
Returns
array
Calculate the offset from the left of the object
if an orientation is activated
getOffsetLeft(boolean $recalculate = false
) : float
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getOffsetLeft() |
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
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getOffsetTop() |
Parameters
$recalculate
boolean
Returns
float
Retrieve orientation of barcode and text
getOrientation() : float
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getOrientation() |
Returns
float
Quiet zone before first bar
and after the last bar
getQuietZone() : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getQuietZone() |
Returns
integer
Retrieve text to encode
getRawText() : string
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getRawText() |
Returns
string
Retrieve if the adjustment of the position of the characters
to the position of the bars is enabled
getStretchText() : boolean
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getStretchText() |
Returns
boolean
Retrieve text to encode
getText() : string
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getText() |
Returns
string
Retrieve text to display
getTextToDisplay() : string
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getTextToDisplay() |
Returns
string
Retrieve type of barcode
getType() : string
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getType() |
Returns
string
Get width of the result object
getWidth(boolean $recalculate = false
) : integer
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getWidth() |
Parameters
$recalculate
boolean
Returns
integer
Retrieve if border are draw or not
getWithBorder() : boolean
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getWithBorder() |
Returns
boolean
Retrieve if the checksum character is automatically
added to the barcode text
getWithChecksum() : boolean
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getWithChecksum() |
Returns
boolean
Retrieve if the checksum character is automatically
added to the barcode text
getWithChecksumInText() : boolean
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::getWithChecksumInText() |
Returns
boolean
Retrieve if quiet zones are draw or not
getWithQuietZones() : boolean
Inherited
Set the color of the background
setBackgroundColor(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setBackgroundColor() |
Parameters
$value
integer
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set height of the barcode bar
setBarHeight(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setBarHeight() |
Parameters
$value
integer
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set thickness of thick bar
setBarThickWidth(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setBarThickWidth() |
Parameters
$value
integer
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set thickness of thin bar
setBarThinWidth(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setBarThinWidth() |
Parameters
$value
integer
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set barcode namespace for autoloading
setBarcodeNamespace(string $namespace) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setBarcodeNamespace() |
Parameters
$namespace
string
Returns
\Zend\Barcode\Object\ObjectInterface
Activate/deactivate drawing of text to encode
setDrawText(boolean $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setDrawText() |
Parameters
$value
boolean
Returns
\Zend\Barcode\Object\ObjectInterface
Set factor applying to
thinBarWidth - thickBarWidth - barHeight - fontSize
setFactor(integer|float|string|boolean $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setFactor() |
Parameters
$value
integer
float
string
boolean
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
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\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setFont() |
Parameters
$value
integer
string
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set the size of the font in case of TTF
setFontSize(float $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setFontSize() |
Parameters
$value
float
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set color of the barcode and text
setForeColor(string $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setForeColor() |
Parameters
$value
string
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set barcode state from options array
setOptions(array $options) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setOptions() |
Parameters
$options
array
Returns
\Zend\Barcode\Object\ObjectInterface
Set orientation of barcode and text
setOrientation(integer|float|string|boolean $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setOrientation() |
Parameters
$value
integer
float
string
boolean
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Allow fast inversion of font/bars color and background color
setReverseColor() : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setReverseColor() |
Returns
\Zend\Barcode\Object\ObjectInterface
Activate/deactivate the adjustment of the position
of the characters to the position of the bars
setStretchText(boolean $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setStretchText() |
Parameters
$value
boolean
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Set text to encode
setText(string $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setText() |
Parameters
$value
string
Returns
\Zend\Barcode\Object\ObjectInterface
Activate/deactivate drawing of the bar
setWithBorder(boolean $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setWithBorder() |
Parameters
$value
boolean
Returns
\Zend\Barcode\Object\ObjectInterface
Activate/deactivate the automatic generation
of the checksum character
added to the barcode text
setWithChecksum(boolean $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setWithChecksum() |
Parameters
$value
boolean
Returns
\Zend\Barcode\Object\ObjectInterface
Activate/deactivate the automatic generation
of the checksum character
added to the barcode text
setWithChecksumInText(boolean $value) : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::setWithChecksumInText() |
Parameters
$value
boolean
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Returns
\Zend\Barcode\Object\ObjectInterface
Activate/deactivate drawing of the quiet zones
setWithQuietZones(boolean $value) : \Zend\Barcode\Object\AbstractObject
Inherited
Parameters
$value
boolean
Returns
\Zend\Barcode\Object\AbstractObject
Check for invalid characters
validateText(string $value)
Inherited
inherited_from |
\Zend\Barcode\Object\ObjectInterface::validateText() |
Parameters
$value
string
Text to be checked
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<mixed,integer> $position, string $font, integer $color, string $alignment = 'center'
, float|integer $orientation = 0
)
Inherited
Parameters
$text
string
$size
float
$position
array<mixed,integer>
$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\AbstractObject::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\ExceptionInterface |
|
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\ExceptionInterface |
|
Partial check of Codabar barcode
checkSpecificParams() : void
inherited_from |
\Zend\Barcode\Object\AbstractObject::checkSpecificParams() |
Checking of parameters after all settings
checkSpecificParams()
Inherited
Check if a text is really provided to barcode
checkText(string|null $value = null
)
Inherited
Parameters
$value
string
null
Exceptions
\Zend\Barcode\Object\Exception\ExceptionInterface |
|
Draw the barcode
drawBarcode()
Inherited
Partial function to draw border
drawBorder()
Inherited
Partial function to draw text
drawText()
Inherited
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\AbstractObject::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
validateSpecificText(string $value, array $options = array()
)
Inherited
Parameters
$value
string
$options
array
Properties
Activate automatic addition of leading zeros
if barcode length is fixed
$addLeadingZeros : boolean
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 : integer
Namespace of the barcode for autoloading
$barcodeNamespace : string
Default
'Zend\Barcode\Object'
Coding map
- 0 = space
- 1 = bar
$codingMap : array
Default
array('0' => "101010011", '1' => "101011001", '2' => "101001011", '3' => "110010101", '4' => "101101001", '5' => "110101001", '6' => "100101011", '7' => "100101101", '8' => "100110101", '9' => "110100101", '-' => "101001101", '$' => "101100101", ':' => "1101011011", '/' => "1101101011", '.' => "1101101101", '+' => "1011011011", 'A' => "1011001001", 'B' => "1010010011", 'C' => "1001001011", 'D' => "1010011001")
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 : boolean
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
Adjust (or not) position of human readable characters with barcode
$stretchText : boolean
Character used to substitute checksum character for validation
$substituteChecksumCharacter : mixed
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