Interface for generate Barcode

 Methods

Constructor

__construct(array | \Traversable $options) 

Parameters

$options

array\Traversable

Checking of parameters after all settings

checkParams() : void

Complete drawing of the barcode

draw() : array

Returns

arrayTable of instructions

Retrieve background color of the image

getBackgroundColor() : int

Returns

int

Get height of the barcode bar

getBarHeight() : int

Returns

int

Get thickness of thick bar

getBarThickWidth() : int

Returns

int

Get thickness of thin bar

getBarThinWidth() : int

Returns

int

Retrieve barcode namespace

getBarcodeNamespace() : string

Returns

string

Retrieve if drawing of text to encode is enabled

getDrawText() : bool

Returns

bool

Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

getFactor() : int

Returns

int

Retrieve the font

getFont() : int | string

Returns

intstring

Retrieve the size of the font in case of TTF

getFontSize() : float

Returns

float

Retrieve color of the barcode and text

getForeColor() : int

Returns

int

Get height of the result object

getHeight(bool $recalculate) : int

Parameters

$recalculate

bool

Returns

int

Retrieve the set of drawing instructions

getInstructions() : array

Returns

array

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

getOffsetLeft(bool $recalculate) : float

Parameters

$recalculate

bool

Returns

float

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

getOffsetTop(bool $recalculate) : float

Parameters

$recalculate

bool

Returns

float

Retrieve orientation of barcode and text

getOrientation() : float

Returns

float

Quiet zone before first bar and after the last bar

getQuietZone() : int

Returns

int

Retrieve text to encode

getRawText() : string

Returns

string

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

getStretchText() : bool

Returns

bool

Retrieve text to encode

getText() : string

Returns

string

Retrieve text to display

getTextToDisplay() : string

Returns

string

Retrieve type of barcode

getType() : string

Returns

string

Get width of the result object

getWidth(bool $recalculate) : int

Parameters

$recalculate

bool

Returns

int

Retrieve if border are draw or not

getWithBorder() : bool

Returns

bool

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

getWithChecksum() : bool

Returns

bool

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

getWithChecksumInText() : bool

Returns

bool

Set the color of the background

setBackgroundColor(int $value) : \Zend\Barcode\Object\ObjectInterface

Parameters

$value

int

Returns

Set height of the barcode bar

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

Parameters

$value

int

Returns

Set thickness of thick bar

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

Parameters

$value

int

Returns

Set thickness of thin bar

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

Parameters

$value

int

Returns

Set barcode namespace for autoloading

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

Parameters

$namespace

string

Returns

Activate/deactivate drawing of text to encode

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

Parameters

$value

bool

Returns

Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

setFactor(int $value) : \Zend\Barcode\Object\ObjectInterface

Parameters

$value

int

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

Parameters

$value

intstring

Returns

Set the size of the font in case of TTF

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

Parameters

$value

float

Returns

Set color of the barcode and text

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

Parameters

$value

string

Returns

Set barcode state from options array

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

Parameters

$options

array

Returns

Set orientation of barcode and text

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

Parameters

$value

float

Returns

Allow fast inversion of font/bars color and background color

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

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

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

Parameters

$value

bool

Returns

Set text to encode

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

Parameters

$value

string

Returns

Activate/deactivate drawing of the bar

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

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

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

Parameters

$value

bool

Returns

Check for invalid characters

validateText(string $value) : void

Parameters

$value

string

Text to be checked