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.
Class for generate Barcode
$_addLeadingZeros $_addLeadingZeros = 'true'
Activate automatic addition of leading zeros if barcode length is fixed
integer $_backgroundColor = '0xFFFFFF'
Background color of the object
integer $_barHeight = '50'
Height of the bar
integer $_barThickWidth = '3'
Width of a thick bar
integer $_barThinWidth = '1'
Width of a thin bar
$_barcodeLength $_barcodeLength = 'null'
Fix barcode length (numeric or string like 'even')
string $_barcodeNamespace = 'Zend_Barcode_Object'
Namespace of the barcode for autoloading
boolean $_drawText = 'true'
Display (or not) human readable text
integer $_factor = '1'
Factor to multiply bar and font measure (barHeight, barThinWidth, barThickWidth & fontSize)
integer|string $_font = 'null'
Font resource - integer (1 to 5): corresponds to GD included fonts - string: corresponds to path of a TTF font
float $_fontSize = '10'
Font size
integer $_foreColor = '0x000000'
Font and bars color of the object
integer $_height = 'null'
Height of the object
array $_instructions = 'array'
Set of drawing instructions
$_mandatoryChecksum $_mandatoryChecksum = 'false'
Activation of mandatory checksum to deactivate unauthorized modification
integer $_offsetLeft = 'null'
Offset from the left the object (calculated from the orientation)
integer $_offsetTop = 'null'
Offset from the top the object (calculated from the orientation)
float $_orientation = '0'
Orientation of the barcode in degrees
string $_staticFont = 'null'
TTF font name: can be set before instanciation of the object
boolean $_stretchText = 'false'
Adjust (or not) position of human readable characters with barcode
$_substituteChecksumCharacter $_substituteChecksumCharacter = '0'
Character used to substitute checksum character for validation
string $_text = 'null'
Text to display
string $_type = 'null'
Barcode type
integer $_width = 'null'
Width of the object
boolean $_withBorder = 'false'
Activate/deactivate border of the object
boolean $_withChecksum = 'false'
Drawing of checksum
boolean $_withChecksumInText = 'false'
Drawing of checksum inside text
__construct(
array|Zend_Config $options
=
null
)
:
void
Constructor
_addInstruction(
array $instruction
)
:
Add an instruction in the array of instructions
_addLeadingZeros(
string $text, boolean $withoutChecksum
=
false
)
:
Automatically add leading zeros if barcode length is fixed
_addPolygon(
array $points, integer $color
=
null, boolean $filled
=
true
)
:
Add a polygon drawing instruction in the set of instructions
_addText(
string $text, float $size, array $position, string $font, integer $color, string $alignment
=
center, float $orientation
=
0
)
:
Add a text drawing instruction in the set of instructions
_calculateBarcodeHeight(
)
:
integer
Height of the barcode
_calculateBarcodeWidth(
)
:
integer
Calculate the width of the barcode
_calculateHeight(
)
:
integer
Height of the result object
_calculateWidth(
)
:
integer
Width of the result image (before any rotation)
_checkFontAndOrientation(
)
:
void
Drawing with an angle is just allow TTF font
_checkParams(
)
:
void
Checking of parameters after all settings
_checkRatio(
integer $min
=
2, integer $max
=
3
)
:
void
Check the ratio between the thick and the thin bar
_checkText(
$value
=
null
)
:
void
Check if a text is really provided to barcode
_drawBarcode(
)
:
void
Draw the barcode
_drawBorder(
)
:
void
Partial function to draw border
_drawText(
)
:
void
Partial function to draw text
_getDefaultOptions(
)
:
void
Set default options for particular object
_postDrawBarcode(
)
:
void
Allow each child to draw something else (ex: bearer bars in interleaved 2 of 5 code)
_preDrawBarcode(
)
:
void
Allow each child to draw something else
_prepareBarcode(
)
:
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 => ...
)
_rotate(
float $x1, float $y1
)
:
array
Apply rotation on a point in X/Y dimensions
_validateText(
string $value, array $options
=
array
)
:
Standard validation for most of barcode objects
checkParams(
)
:
void
Checking of parameters after all settings
draw(
)
:
array
Complete drawing of the barcode
getBackgroundColor(
)
:
integer
Retrieve background color of the image
getBarHeight(
)
:
integer
Get height of the barcode bar
getBarThickWidth(
)
:
integer
Get thickness of thick bar
getBarThinWidth(
)
:
integer
Get thickness of thin bar
getBarcodeNamespace(
)
:
string
Retrieve barcode namespace
getDrawText(
)
:
boolean
Retrieve if drawing of text to encode is enabled
getFactor(
)
:
integer
Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize
getFont(
)
:
integer|string
Retrieve the font
getFontSize(
)
:
float
Retrieve the size of the font in case of TTF
getForeColor(
)
:
unknown
Retrieve color of the barcode and text
getHeight(
$recalculate
=
false
)
:
integer
Get height of the result object
getInstructions(
)
:
array
Retrieve the set of drawing instructions
getOffsetLeft(
boolean $recalculate
=
false
)
:
float
Calculate the offset from the left of the object if an orientation is activated
getOffsetTop(
boolean $recalculate
=
false
)
:
float
Calculate the offset from the top of the object if an orientation is activated
getOrientation(
)
:
float
Retrieve orientation of barcode and text
getQuietZone(
)
:
integer
Quiet zone before first bar and after the last bar
getRawText(
)
:
string
Retrieve text to encode
getStretchText(
)
:
boolean
Retrieve if the adjustment of the position of the characters to the position of the bars is enabled
getText(
)
:
string
Retrieve text to encode
getTextToDisplay(
)
:
string
Retrieve text to display
getType(
)
:
string
Retrieve type of barcode
getWidth(
$recalculate
=
false
)
:
integer
Get width of the result object
getWithBorder(
)
:
boolean
Retrieve if border are draw or not
getWithChecksum(
)
:
boolean
Retrieve if the checksum character is automatically added to the barcode text
getWithChecksumInText(
)
:
boolean
Retrieve if the checksum character is automatically added to the barcode text
setBackgroundColor(
integer $value
)
:
Zend_Barcode_Object
Set the color of the background
setBarHeight(
integer $value
)
:
Zend_Barcode_Object
Set height of the barcode bar
setBarThickWidth(
integer $value
)
:
Zend_Barcode_Object
Set thickness of thick bar
setBarThinWidth(
integer $value
)
:
Zend_Barcode_Object
Set thickness of thin bar
setBarcodeFont(
string $font
)
:
void
Set the font for all instances of barcode
setBarcodeNamespace(
string $namespace
)
:
Zend_Barcode_Object
Set barcode namespace for autoloading
setConfig(
Zend_Config $config
)
:
Zend_Barcode_Object
Set barcode state from config object
setDrawText(
boolean $value
)
:
Zend_Barcode_Object
Activate/deactivate drawing of text to encode
setFactor(
integer $value
)
:
Zend_Barcode_Object
Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize
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
setFontSize(
float $value
)
:
Zend_Barcode_Object
Set the size of the font in case of TTF
setForeColor(
string $value
)
:
Zend_Barcode_Object
Set color of the barcode and text
setOptions(
array $options
)
:
Zend_Barcode_Object
Set barcode state from options array
setOrientation(
float $value
)
:
Zend_Barcode_Object
Set orientation of barcode and text
setReverseColor(
)
:
Zend_Barcode_Object
Allow fast inversion of font/bars color and background color
setStretchText(
boolean $value
)
:
Zend_Barcode_Object
Activate/deactivate the adjustment of the position of the characters to the position of the bars
setText(
string $value
)
:
Zend_Barcode_Object
Set text to encode
setWithBorder(
boolean $value
)
:
Zend_Barcode_Object
Activate/deactivate drawing of the bar
setWithChecksum(
boolean $value
)
:
Zend_Barcode_Object
Activate/deactivate the automatic generation of the checksum character added to the barcode text
setWithChecksumInText(
boolean $value
)
:
Zend_Barcode_Object
Activate/deactivate the automatic generation of the checksum character added to the barcode text
validateText(
string $value
)
:
void
Check for invalid characters