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
Detailsinteger $_backgroundColor = '0xFFFFFF'Background color of the object
Detailsinteger $_barHeight = '50'Height of the bar
Detailsinteger $_barThickWidth = '3'Width of a thick bar
Detailsinteger $_barThinWidth = '1'Width of a thin bar
Details$_barcodeLength $_barcodeLength = 'null'Fix barcode length (numeric or string like 'even')
Detailsstring $_barcodeNamespace = 'Zend_Barcode_Object'Namespace of the barcode for autoloading
Detailsboolean $_drawText = 'true'Display (or not) human readable text
Detailsinteger $_factor = '1'Factor to multiply bar and font measure (barHeight, barThinWidth, barThickWidth & fontSize)
Detailsinteger|string $_font = 'null'Font resource - integer (1 to 5): corresponds to GD included fonts - string: corresponds to path of a TTF font
Detailsfloat $_fontSize = '10'Font size
Detailsinteger $_foreColor = '0x000000'Font and bars color of the object
Detailsinteger $_height = 'null'Height of the object
Detailsarray $_instructions = 'array'Set of drawing instructions
Details$_mandatoryChecksum $_mandatoryChecksum = 'false'Activation of mandatory checksum to deactivate unauthorized modification
Detailsinteger $_offsetLeft = 'null'Offset from the left the object (calculated from the orientation)
Detailsinteger $_offsetTop = 'null'Offset from the top the object (calculated from the orientation)
Detailsfloat $_orientation = '0'Orientation of the barcode in degrees
Detailsstring $_staticFont = 'null'TTF font name: can be set before instanciation of the object
Detailsboolean $_stretchText = 'false'Adjust (or not) position of human readable characters with barcode
Details$_substituteChecksumCharacter $_substituteChecksumCharacter = '0'Character used to substitute checksum character for validation
Detailsstring $_text = 'null'Text to display
Detailsstring $_type = 'null'Barcode type
Detailsinteger $_width = 'null'Width of the object
Detailsboolean $_withBorder = 'false'Activate/deactivate border of the object
Detailsboolean $_withChecksum = 'false'Drawing of checksum
Detailsboolean $_withChecksumInText = 'false'Drawing of checksum inside text
Details__construct(
array|Zend_Config $options
=
null
)
:
voidConstructor
Details_addInstruction(
array $instruction
)
:
Add an instruction in the array of instructions
Details_addLeadingZeros(
string $text, boolean $withoutChecksum
=
false
)
:
Automatically add leading zeros if barcode length is fixed
Details_addPolygon(
array $points, integer $color
=
null, boolean $filled
=
true
)
:
Add a polygon drawing instruction in the set of instructions
Details_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
Details_calculateBarcodeHeight(
)
:
integerHeight of the barcode
Details_calculateBarcodeWidth(
)
:
integerCalculate the width of the barcode
Details_calculateHeight(
)
:
integerHeight of the result object
Details_calculateWidth(
)
:
integerWidth of the result image (before any rotation)
Details_checkFontAndOrientation(
)
:
voidDrawing with an angle is just allow TTF font
Details_checkParams(
)
:
voidChecking of parameters after all settings
Details_checkRatio(
integer $min
=
2, integer $max
=
3
)
:
voidCheck the ratio between the thick and the thin bar
Details_checkText(
$value
=
null
)
:
voidCheck if a text is really provided to barcode
Details_drawBarcode(
)
:
voidDraw the barcode
Details_drawBorder(
)
:
voidPartial function to draw border
Details_drawText(
)
:
voidPartial function to draw text
Details_getDefaultOptions(
)
:
voidSet default options for particular object
Details_postDrawBarcode(
)
:
voidAllow each child to draw something else (ex: bearer bars in interleaved 2 of 5 code)
Details_preDrawBarcode(
)
:
voidAllow each child to draw something else
Details_prepareBarcode(
)
:
arrayEach 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 => ...
)
Details_rotate(
float $x1, float $y1
)
:
arrayApply rotation on a point in X/Y dimensions
Details_validateText(
string $value, array $options
=
array
)
:
Standard validation for most of barcode objects
DetailscheckParams(
)
:
voidChecking of parameters after all settings
Detailsdraw(
)
:
arrayComplete drawing of the barcode
DetailsgetBackgroundColor(
)
:
integerRetrieve background color of the image
DetailsgetBarHeight(
)
:
integerGet height of the barcode bar
DetailsgetBarThickWidth(
)
:
integerGet thickness of thick bar
DetailsgetBarThinWidth(
)
:
integerGet thickness of thin bar
DetailsgetBarcodeNamespace(
)
:
stringRetrieve barcode namespace
DetailsgetDrawText(
)
:
booleanRetrieve if drawing of text to encode is enabled
DetailsgetFactor(
)
:
integerGet factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize
DetailsgetFont(
)
:
integer|stringRetrieve the font
DetailsgetFontSize(
)
:
floatRetrieve the size of the font in case of TTF
DetailsgetForeColor(
)
:
unknownRetrieve color of the barcode and text
DetailsgetHeight(
$recalculate
=
false
)
:
integerGet height of the result object
DetailsgetInstructions(
)
:
arrayRetrieve the set of drawing instructions
DetailsgetOffsetLeft(
boolean $recalculate
=
false
)
:
floatCalculate the offset from the left of the object if an orientation is activated
DetailsgetOffsetTop(
boolean $recalculate
=
false
)
:
floatCalculate the offset from the top of the object if an orientation is activated
DetailsgetOrientation(
)
:
floatRetrieve orientation of barcode and text
DetailsgetQuietZone(
)
:
integerQuiet zone before first bar and after the last bar
DetailsgetRawText(
)
:
stringRetrieve text to encode
DetailsgetStretchText(
)
:
booleanRetrieve if the adjustment of the position of the characters to the position of the bars is enabled
DetailsgetText(
)
:
stringRetrieve text to encode
DetailsgetTextToDisplay(
)
:
stringRetrieve text to display
DetailsgetType(
)
:
stringRetrieve type of barcode
DetailsgetWidth(
$recalculate
=
false
)
:
integerGet width of the result object
DetailsgetWithBorder(
)
:
booleanRetrieve if border are draw or not
DetailsgetWithChecksum(
)
:
booleanRetrieve if the checksum character is automatically added to the barcode text
DetailsgetWithChecksumInText(
)
:
booleanRetrieve if the checksum character is automatically added to the barcode text
DetailssetBackgroundColor(
integer $value
)
:
Zend_Barcode_ObjectSet the color of the background
DetailssetBarHeight(
integer $value
)
:
Zend_Barcode_ObjectSet height of the barcode bar
DetailssetBarThickWidth(
integer $value
)
:
Zend_Barcode_ObjectSet thickness of thick bar
DetailssetBarThinWidth(
integer $value
)
:
Zend_Barcode_ObjectSet thickness of thin bar
DetailssetBarcodeFont(
string $font
)
:
voidSet the font for all instances of barcode
DetailssetBarcodeNamespace(
string $namespace
)
:
Zend_Barcode_ObjectSet barcode namespace for autoloading
DetailssetConfig(
Zend_Config $config
)
:
Zend_Barcode_ObjectSet barcode state from config object
DetailssetDrawText(
boolean $value
)
:
Zend_Barcode_ObjectActivate/deactivate drawing of text to encode
DetailssetFactor(
integer $value
)
:
Zend_Barcode_ObjectSet factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize
DetailssetFont(
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
DetailssetFontSize(
float $value
)
:
Zend_Barcode_ObjectSet the size of the font in case of TTF
DetailssetForeColor(
string $value
)
:
Zend_Barcode_ObjectSet color of the barcode and text
DetailssetOptions(
array $options
)
:
Zend_Barcode_ObjectSet barcode state from options array
DetailssetOrientation(
float $value
)
:
Zend_Barcode_ObjectSet orientation of barcode and text
DetailssetReverseColor(
)
:
Zend_Barcode_ObjectAllow fast inversion of font/bars color and background color
DetailssetStretchText(
boolean $value
)
:
Zend_Barcode_ObjectActivate/deactivate the adjustment of the position of the characters to the position of the bars
DetailssetText(
string $value
)
:
Zend_Barcode_ObjectSet text to encode
DetailssetWithBorder(
boolean $value
)
:
Zend_Barcode_ObjectActivate/deactivate drawing of the bar
DetailssetWithChecksum(
boolean $value
)
:
Zend_Barcode_ObjectActivate/deactivate the automatic generation of the checksum character added to the barcode text
DetailssetWithChecksumInText(
boolean $value
)
:
Zend_Barcode_ObjectActivate/deactivate the automatic generation of the checksum character added to the barcode text
DetailsvalidateText(
string $value
)
:
voidCheck for invalid characters
Details