Class for generate Code128 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() : int
Inherited

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

Returns

int

Get height of the barcode bar

getBarHeight() : int
Inherited

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

Returns

int

Get thickness of thick bar

getBarThickWidth() : int
Inherited

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

Returns

int

Get thickness of thin bar

getBarThinWidth() : int
Inherited

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

Returns

int

Retrieve barcode namespace

getBarcodeNamespace() : string
Inherited

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

Returns

string

Get barcode checksum

getChecksum(string $text) : int

Parameters

$text

string

Returns

int

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() : int
Inherited

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

Returns

int

Retrieve the font

getFont() : int | string
Inherited

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

Returns

intstring

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() : int
Inherited

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

Returns

int

Get height of the result object

getHeight(bool $recalculate) : int
Inherited

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

Parameters

$recalculate

bool

Returns

int

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() : int
Inherited

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

Returns

int

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

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) : int
Inherited

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

Parameters

$recalculate

bool

Returns

int

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(int $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

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

Parameters

$value

int

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set height of the barcode bar

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

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

Parameters

$value

int

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set thickness of thick bar

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

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

Parameters

$value

int

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Returns

Set thickness of thin bar

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

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

Parameters

$value

int

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(int | float | string | bool $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

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

Parameters

$value

intfloatstringbool

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(int | string $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

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

Parameters

$value

intstring

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(int | float | string | bool $value) : \Zend\Barcode\Object\ObjectInterface
Inherited

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

Parameters

$value

intfloatstringbool

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\Code128

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

Checks if the next $length chars of $string starting at $pos are numeric.

_isDigit(string $string, int $pos, int $length) : bool

Returns false if the end of the string is reached.

Parameters

$string

string

String to search

$pos

int

Starting position

$length

int

Length to search

Returns

bool

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, int $color, bool $filled) 
Inherited

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

Parameters

$points

array

$color

int

$filled

bool

Add a text drawing instruction in the set of instructions

addText(string $text, float $size, int[] $position, string $font, int $color, string $alignment, float | int $orientation) 
Inherited

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

Parameters

$text

string

$size

float

$position

int[]

$font

string

$color

int

$alignment

string

$orientation

floatint

Height of the barcode

calculateBarcodeHeight() : int
Inherited

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

Returns

int

Width of the barcode (in pixels)

calculateBarcodeWidth() : int

Returns

int

Height of the result object

calculateHeight() : int
Inherited

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

Returns

int

Width of the result image (before any rotation)

calculateWidth() : int
Inherited

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

Returns

int

Drawing with an angle is just allow TTF font

checkFontAndOrientation() 
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(int $min, int $max) 
Inherited

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

Parameters

$min

int

$max

int

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Partial check of code128 barcode

checkSpecificParams() : void

Check if a text is really provided to barcode

checkText(string | null $value) 
Inherited

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

Parameters

$value

stringnull

Exceptions

\Zend\Barcode\Object\Exception\ExceptionInterface

Convert string to barcode string

convertToBarcodeChars(string $string) : array

Parameters

$string

string

Returns

array

Draw the barcode

drawBarcode() 
Inherited

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

Partial function to draw border

drawBorder() 
Inherited

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

Partial function to draw text

drawText() 
Inherited

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

Set default options for particular object

getDefaultOptions() 
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() 
Inherited

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

Allow each child to draw something else

preDrawBarcode() 
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 : int
Inherited

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

Height of the bar

$barHeight : int
Inherited

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

Width of a thick bar

$barThickWidth : int
Inherited

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

Width of a thin bar

$barThinWidth : int
Inherited

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

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

$barcodeLength : int
Inherited

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

Namespace of the barcode for autoloading

$barcodeNamespace : string
Inherited

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

Character sets ABC

$charSets : array

 

$codingMap

$codingMap 

 

$convertedText

$convertedText : 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 : int
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 : int | 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 : int
Inherited

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

Height of the object

$height : int
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 : int
Inherited

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

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

$offsetTop : int
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 : int
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 (even if it's sometime optional, most of time it's required)

$withChecksum : bool

 

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