Class Postnet

Summary

Fully Qualified Name: Zend\Barcode\Object\Postnet
Extends: AbstractObject

Description

Class for generate Postnet barcode

Methods

Name Description Defined By
__construct() Constructor AbstractObject
checkParams() Checking of parameters after all settings AbstractObject
draw() Complete drawing of the barcode AbstractObject
getBackgroundColor() Retrieve background color of the image AbstractObject
getBarHeight() Get height of the barcode bar AbstractObject
getBarThickWidth() Get thickness of thick bar AbstractObject
getBarThinWidth() Get thickness of thin bar AbstractObject
getBarcodeNamespace() Retrieve barcode namespace AbstractObject
getChecksum() Get barcode checksum Postnet
getDrawText() Retrieve if drawing of text to encode is enabled AbstractObject
getFactor() Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize AbstractObject
getFont() Retrieve the font AbstractObject
getFontSize() Retrieve the size of the font in case of TTF AbstractObject
getForeColor() Retrieve color of the barcode and text AbstractObject
getHeight() Get height of the result object AbstractObject
getInstructions() Retrieve the set of drawing instructions AbstractObject
getOffsetLeft() Calculate the offset from the left of the object if an orientation is activated AbstractObject
getOffsetTop() Calculate the offset from the top of the object if an orientation is activated AbstractObject
getOrientation() Retrieve orientation of barcode and text AbstractObject
getQuietZone() Quiet zone before first bar and after the last bar AbstractObject
getRawText() Retrieve text to encode AbstractObject
getStretchText() Retrieve if the adjustment of the position of the characters to the position of the bars is enabled AbstractObject
getText() Retrieve text to encode AbstractObject
getTextToDisplay() Retrieve text to display AbstractObject
getType() Retrieve type of barcode AbstractObject
getWidth() Get width of the result object AbstractObject
getWithBorder() Retrieve if border are draw or not AbstractObject
getWithChecksum() Retrieve if the checksum character is automatically added to the barcode text AbstractObject
getWithChecksumInText() Retrieve if the checksum character is automatically added to the barcode text AbstractObject
getWithQuietZones() Retrieve if quiet zones are draw or not AbstractObject
setBackgroundColor() Set the color of the background AbstractObject
setBarHeight() Set height of the barcode bar AbstractObject
setBarThickWidth() Set thickness of thick bar AbstractObject
setBarThinWidth() Set thickness of thin bar AbstractObject
setBarcodeNamespace() Set barcode namespace for autoloading AbstractObject
setDrawText() Activate/deactivate drawing of text to encode AbstractObject
setFactor() Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize AbstractObject
setFont() 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 AbstractObject
setFontSize() Set the size of the font in case of TTF AbstractObject
setForeColor() Set color of the barcode and text AbstractObject
setOptions() Set barcode state from options array AbstractObject
setOrientation() Set orientation of barcode and text AbstractObject
setReverseColor() Allow fast inversion of font/bars color and background color AbstractObject
setStretchText() Activate/deactivate the adjustment of the position of the characters to the position of the bars AbstractObject
setText() Set text to encode AbstractObject
setWithBorder() Activate/deactivate drawing of the bar AbstractObject
setWithChecksum() Activate/deactivate the automatic generation of the checksum character added to the barcode text AbstractObject
setWithChecksumInText() Activate/deactivate the automatic generation of the checksum character added to the barcode text AbstractObject
setWithQuietZones() Activate/deactivate drawing of the quiet zones AbstractObject
validateText() Check for invalid characters AbstractObject

Method Details

__construct()

Constructor

Parameter Name Type Description
$options array|\Traversable

Returns:

checkParams()

Checking of parameters after all settings

Returns: bool

draw()

Complete drawing of the barcode

Returns: array Table of instructions

getBackgroundColor()

Retrieve background color of the image

Returns: int

getBarHeight()

Get height of the barcode bar

Returns: int

getBarThickWidth()

Get thickness of thick bar

Returns: int

getBarThinWidth()

Get thickness of thin bar

Returns: int

getBarcodeNamespace()

Retrieve barcode namespace

Returns: string

getChecksum()

Get barcode checksum

Parameter Name Type Description
$text string

Returns: int

getDrawText()

Retrieve if drawing of text to encode is enabled

Returns: bool

getFactor()

Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

Returns: int

getFont()

Retrieve the font

Returns: int|string

getFontSize()

Retrieve the size of the font in case of TTF

Returns: float

getForeColor()

Retrieve color of the barcode and text

Returns: int

getHeight()

Get height of the result object

Parameter Name Type Description
$recalculate bool

Returns: int

getInstructions()

Retrieve the set of drawing instructions

Returns: array

getOffsetLeft()

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

Parameter Name Type Description
$recalculate bool

Returns: float

getOffsetTop()

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

Parameter Name Type Description
$recalculate bool

Returns: float

getOrientation()

Retrieve orientation of barcode and text

Returns: float

getQuietZone()

Quiet zone before first bar and after the last bar

Returns: int

getRawText()

Retrieve text to encode

Returns: string

getStretchText()

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

Returns: bool

getText()

Retrieve text to encode

Returns: string

getTextToDisplay()

Retrieve text to display

Returns: string

getType()

Retrieve type of barcode

Returns: string

getWidth()

Get width of the result object

Parameter Name Type Description
$recalculate bool

Returns: int

getWithBorder()

Retrieve if border are draw or not

Returns: bool

getWithChecksum()

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

Returns: bool

getWithChecksumInText()

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

Returns: bool

getWithQuietZones()

Retrieve if quiet zones are draw or not

Returns: bool

setBackgroundColor()

Set the color of the background

Parameter Name Type Description
$value int

Returns: self Provides a fluent interface

setBarHeight()

Set height of the barcode bar

Parameter Name Type Description
$value int

Returns: self Provides a fluent interface

setBarThickWidth()

Set thickness of thick bar

Parameter Name Type Description
$value int

Returns: self Provides a fluent interface

setBarThinWidth()

Set thickness of thin bar

Parameter Name Type Description
$value int

Returns: self Provides a fluent interface

setBarcodeNamespace()

Set barcode namespace for autoloading

Parameter Name Type Description
$namespace string

Returns: self Provides a fluent interface

setDrawText()

Activate/deactivate drawing of text to encode

Parameter Name Type Description
$value bool

Returns: self Provides a fluent interface

setFactor()

Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

Parameter Name Type Description
$value int|float|string|bool

Returns: self Provides a fluent interface

setFont()

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

Parameter Name Type Description
$value int|string

Returns: self Provides a fluent interface

setFontSize()

Set the size of the font in case of TTF

Parameter Name Type Description
$value float

Returns: self Provides a fluent interface

setForeColor()

Set color of the barcode and text

Parameter Name Type Description
$value string

Returns: self Provides a fluent interface

setOptions()

Set barcode state from options array

Parameter Name Type Description
$options array

Returns: self Provides a fluent interface

setOrientation()

Set orientation of barcode and text

Parameter Name Type Description
$value int|float|string|bool

Returns: self Provides a fluent interface

setReverseColor()

Allow fast inversion of font/bars color and background color

Returns: self Provides a fluent interface

setStretchText()

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

Parameter Name Type Description
$value bool

Returns: self Provides a fluent interface

setText()

Set text to encode

Parameter Name Type Description
$value string

Returns: self Provides a fluent interface

setWithBorder()

Activate/deactivate drawing of the bar

Parameter Name Type Description
$value bool

Returns: self Provides a fluent interface

setWithChecksum()

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

Parameter Name Type Description
$value bool

Returns: self Provides a fluent interface

setWithChecksumInText()

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

Parameter Name Type Description
$value bool

Returns: self Provides a fluent interface

setWithQuietZones()

Activate/deactivate drawing of the quiet zones

Parameter Name Type Description
$value bool

Returns: self Provides a fluent interface

validateText()

Check for invalid characters

Parameter Name Type Description
$value string Text

Returns:

Top