Class for generate Codabar barcode

category Zend
package Zend_Barcode

 Methods

Constructor

__construct(array | \Traversable $options) 
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::__construct()

Parameters

$options

array\Traversable

Checking of parameters after all settings

checkParams() : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::checkParams()

Returns

bool

Complete drawing of the barcode

draw() : array
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::draw()

Returns

arrayTable of instructions

Retrieve background color of the image

getBackgroundColor() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getBackgroundColor()

Returns

integer

Get height of the barcode bar

getBarHeight() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getBarHeight()

Returns

integer

Get thickness of thick bar

getBarThickWidth() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getBarThickWidth()

Returns

integer

Get thickness of thin bar

getBarThinWidth() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getBarThinWidth()

Returns

integer

Retrieve barcode namespace

getBarcodeNamespace() : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getBarcodeNamespace()

Returns

string

Retrieve if drawing of text to encode is enabled

getDrawText() : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getDrawText()

Returns

bool

Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

getFactor() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getFactor()

Returns

integer

Retrieve the font

getFont() : integer | string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getFont()

Returns

integerstring

Retrieve the size of the font in case of TTF

getFontSize() : float
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getFontSize()

Returns

float

Retrieve color of the barcode and text

getForeColor() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getForeColor()

Returns

integer

Get height of the result object

getHeight(bool $recalculate) : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getHeight()

Parameters

$recalculate

bool

Returns

integer

Retrieve the set of drawing instructions

getInstructions() : array
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getInstructions()

Returns

array

Calculate the offset from the left of the object if an orientation is activated

getOffsetLeft(bool $recalculate) : float
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getOffsetLeft()

Parameters

$recalculate

bool

Returns

float

Calculate the offset from the top of the object if an orientation is activated

getOffsetTop(bool $recalculate) : float
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getOffsetTop()

Parameters

$recalculate

bool

Returns

float

Retrieve orientation of barcode and text

getOrientation() : float
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getOrientation()

Returns

float

Quiet zone before first bar and after the last bar

getQuietZone() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getQuietZone()

Returns

integer

Retrieve text to encode

getRawText() : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getRawText()

Returns

string

Retrieve if the adjustment of the position of the characters to the position of the bars is enabled

getStretchText() : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getStretchText()

Returns

bool

Retrieve text to encode

getText() : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getText()

Returns

string

Retrieve text to display

getTextToDisplay() : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getTextToDisplay()

Returns

string

Retrieve type of barcode

getType() : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getType()

Returns

string

Get width of the result object

getWidth(bool $recalculate) : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getWidth()

Parameters

$recalculate

bool

Returns

integer

Retrieve if border are draw or not

getWithBorder() : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getWithBorder()

Returns

bool

Retrieve if the checksum character is automatically added to the barcode text

getWithChecksum() : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getWithChecksum()

Returns

bool

Retrieve if the checksum character is automatically added to the barcode text

getWithChecksumInText() : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getWithChecksumInText()

Returns

bool

Retrieve if quiet zones are draw or not

getWithQuietZones() : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getWithQuietZones()

Returns

bool

Set the color of the background

setBackgroundColor(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setBackgroundColor()

Parameters

$value

integer

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set height of the barcode bar

setBarHeight(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setBarHeight()

Parameters

$value

integer

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set thickness of thick bar

setBarThickWidth(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setBarThickWidth()

Parameters

$value

integer

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set thickness of thin bar

setBarThinWidth(integer $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setBarThinWidth()

Parameters

$value

integer

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set barcode namespace for autoloading

setBarcodeNamespace(string $namespace) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setBarcodeNamespace()

Parameters

$namespace

string

Returns

Activate/deactivate drawing of text to encode

setDrawText(bool $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setDrawText()

Parameters

$value

bool

Returns

Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

setFactor(float $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setFactor()

Parameters

$value

float

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

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\AbstractObject::setFont()

Parameters

$value

integerstring

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set the size of the font in case of TTF

setFontSize(float $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setFontSize()

Parameters

$value

float

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set color of the barcode and text

setForeColor(string $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setForeColor()

Parameters

$value

string

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set barcode state from options array

setOptions(array $options) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setOptions()

Parameters

$options

array

Returns

Set orientation of barcode and text

setOrientation(float $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setOrientation()

Parameters

$value

float

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Allow fast inversion of font/bars color and background color

setReverseColor() : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setReverseColor()

Returns

Activate/deactivate the adjustment of the position of the characters to the position of the bars

setStretchText(bool $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setStretchText()

Parameters

$value

bool

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set text to encode

setText(string $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setText()

Parameters

$value

string

Returns

Activate/deactivate drawing of the bar

setWithBorder(bool $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setWithBorder()

Parameters

$value

bool

Returns

Activate/deactivate the automatic generation of the checksum character added to the barcode text

setWithChecksum(bool $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setWithChecksum()

Parameters

$value

bool

Returns

Activate/deactivate the automatic generation of the checksum character added to the barcode text

setWithChecksumInText(bool $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setWithChecksumInText()

Parameters

$value

bool

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Activate/deactivate drawing of the quiet zones

setWithQuietZones(bool $value) : \Zend\Barcode\Object\AbstractObject
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::setWithQuietZones()

Parameters

$value

bool

Returns

Check for invalid characters

validateText(string $value) : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::validateText()

Parameters

$value

string

Text to be checked

Add an instruction in the array of instructions

addInstruction(array $instruction) 
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::addInstruction()

Parameters

$instruction

array

Automatically add leading zeros if barcode length is fixed

addLeadingZeros(string $text, bool $withoutChecksum) : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::addLeadingZeros()

Parameters

$text

string

$withoutChecksum

bool

Returns

string

Add a polygon drawing instruction in the set of instructions

addPolygon(array $points, integer $color, bool $filled) 
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::addPolygon()

Parameters

$points

array

$color

integer

$filled

bool

Add a text drawing instruction in the set of instructions

addText(string $text, float $size, array $position, string $font, integer $color, string $alignment, float $orientation) 
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::addText()

Parameters

$text

string

$size

float

$position

array

$font

string

$color

integer

$alignment

string

$orientation

float

Height of the barcode

calculateBarcodeHeight() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::calculateBarcodeHeight()

Returns

integer

Width of the barcode (in pixels)

calculateBarcodeWidth() : integer

Returns

integer

Height of the result object

calculateHeight() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::calculateHeight()

Returns

integer

Width of the result image (before any rotation)

calculateWidth() : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::calculateWidth()

Returns

integer

Drawing with an angle is just allow TTF font

checkFontAndOrientation() : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::checkFontAndOrientation()

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Check the ratio between the thick and the thin bar

checkRatio(integer $min, integer $max) : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::checkRatio()

Parameters

$min

integer

$max

integer

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Partial check of Codabar barcode

checkSpecificParams() : void

Check if a text is really provided to barcode

checkText($value) : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::checkText()

Parameters

$value

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Draw the barcode

drawBarcode() : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::drawBarcode()

Partial function to draw border

drawBorder() : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::drawBorder()

Partial function to draw text

drawText() : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::drawText()

Set default options for particular object

getDefaultOptions() : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::getDefaultOptions()

Allow each child to draw something else (ex: bearer bars in interleaved 2 of 5 code)

postDrawBarcode() : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::postDrawBarcode()

Allow each child to draw something else

preDrawBarcode() : void
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::preDrawBarcode()

Prepare array to draw barcode

prepareBarcode() : array

.. )

Returns

array

Apply rotation on a point in X/Y dimensions

rotate(float $x1, float $y1) : array
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::rotate()

Parameters

$x1

float

x-position before rotation

$y1

float

y-position before rotation

Returns

arrayArray of two elements corresponding to the new XY point

Standard validation for most of barcode objects

validateSpecificText(string $value, array $options) 
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::validateSpecificText()

Parameters

$value

string

$options

array

 Properties

 

Activate automatic addition of leading zeros if barcode length is fixed

$addLeadingZeros : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$addLeadingZeros
 

Background color of the object

$backgroundColor : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$backgroundColor
 

Height of the bar

$barHeight : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$barHeight
 

Width of a thick bar

$barThickWidth : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$barThickWidth
 

Width of a thin bar

$barThinWidth : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$barThinWidth
 

Fix barcode length (numeric or string like 'even')

$barcodeLength : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$barcodeLength
 

Namespace of the barcode for autoloading

$barcodeNamespace : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$barcodeNamespace
 

Coding map - 0 = space - 1 = bar

$codingMap : array

 

Display (or not) human readable text

$drawText : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$drawText
 

Factor to multiply bar and font measure (barHeight, barThinWidth, barThickWidth & fontSize)

$factor : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$factor
 

Font resource - integer (1 to 5): corresponds to GD included fonts - string: corresponds to path of a TTF font

$font : integer | string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$font
 

Font size

$fontSize : float
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$fontSize
 

Font and bars color of the object

$foreColor : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$foreColor
 

Height of the object

$height : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$height
 

Set of drawing instructions

$instructions : array
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$instructions
 

Activation of mandatory checksum to deactivate unauthorized modification

$mandatoryChecksum : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$mandatoryChecksum
 

Force quiet zones even if

$mandatoryQuietZones : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$mandatoryQuietZones
 

Offset from the left the object (calculated from the orientation)

$offsetLeft : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$offsetLeft
 

Offset from the top the object (calculated from the orientation)

$offsetTop : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$offsetTop
 

Orientation of the barcode in degrees

$orientation : float
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$orientation
 

Adjust (or not) position of human readable characters with barcode

$stretchText : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$stretchText
 

Character used to substitute checksum character for validation

$substituteChecksumCharacter : mixed
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$substituteChecksumCharacter
 

Text to display

$text : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$text
 

Barcode type

$type : string
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$type
 

Width of the object

$width : integer
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$width
 

Activate/deactivate border of the object

$withBorder : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$withBorder
 

Drawing of checksum

$withChecksum : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$withChecksum
 

Drawing of checksum inside text

$withChecksumInText : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$withChecksumInText
 

Activate/deactivate drawing of quiet zones

$withQuietZones : bool
Inherited

inherited_from \Zend\Barcode\Object\AbstractObject::$$withQuietZones