Class for rendering the barcode as image

package Default
inherited_from \Zend\Barcode\Renderer\AbstractRenderer

 Methods

Constructor

__construct(array|\Traversable $options = null
inherited_from \Zend\Barcode\Renderer\AbstractRenderer::__construct()

Parameters

$options

array\Traversable

Exceptions

\Zend\Barcode\Exception\RendererCreationException

Constructor

__construct(array|\Traversable $options = null
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::__construct()

Parameters

$options

array\Traversable

Checking of parameters after all settings

checkParams() : boolean
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::checkParams()

Returns

boolean

Draw the barcode in the rendering resource

draw() : mixed
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::draw()

Exceptions

\Zend\Barcode\Exception\ExceptionInterface

Returns

mixed

Retrieve the automatic rendering of exception

getAutomaticRenderError() : boolean
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getAutomaticRenderError()

Returns

boolean

Retrieve the barcode object

getBarcode() : \Zend\Barcode\Object\ObjectInterface
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getBarcode()

Returns

\Zend\Barcode\Object\ObjectInterface

Get barcode height

getHeight() : integer

Returns

integer

Horizontal position of the barcode in the rendering resource

getHorizontalPosition() : string
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getHorizontalPosition()

Returns

string

Retrieve the image type to produce

getImageType() : string

Returns

string

Retrieve vertical adjustment

getLeftOffset() : integer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getLeftOffset()

Returns

integer

Set the size of a module

getModuleSize() : float
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getModuleSize()

Returns

float

Retrieve renderer namespace

getRendererNamespace() : string
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getRendererNamespace()

Returns

string

Retrieve vertical adjustment

getTopOffset() : integer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getTopOffset()

Returns

integer

getTransparentBackground()

getTransparentBackground() : boolean
Inherited

Returns

boolean

Retrieve renderer type

getType() : string
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getType()

Returns

string

Vertical position of the barcode in the rendering resource

getVerticalPosition() : string
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::getVerticalPosition()

Returns

string

Get barcode width

getWidth() : integer

Returns

integer

Draw and render the barcode with correct headers

render() : mixed

Returns

mixed

Activate/Deactivate the automatic rendering of exception

setAutomaticRenderError(boolean $value) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setAutomaticRenderError()

Parameters

$value

boolean

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set the barcode object

setBarcode(\Zend\Barcode\Object\ObjectInterface $barcode) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setBarcode()

Parameters

$barcode

\Zend\Barcode\Object\ObjectInterface

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set height of the result image

setHeight(null|integer $value) : \Zend\Barcode\Renderer\Image

Parameters

$value

nullinteger

Exceptions

\Zend\Barcode\Renderer\Exception\OutOfRangeException

Returns

\Zend\Barcode\Renderer\Image

Horizontal position of the barcode in the rendering resource

setHorizontalPosition(string $value) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setHorizontalPosition()

Parameters

$value

string

Exceptions

\Zend\Barcode\Renderer\Exception\UnexpectedValueException

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set the image type to produce (png, jpeg, gif)

setImageType(string $value) : \Zend\Barcode\Renderer\Image

Parameters

$value

string

Exceptions

\Zend\Barcode\Renderer\Exception\InvalidArgumentException

Returns

\Zend\Barcode\Renderer\Image

Manually adjust left position

setLeftOffset(integer $value) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setLeftOffset()

Parameters

$value

integer

Exceptions

\Zend\Barcode\Renderer\Exception\OutOfRangeException

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set the size of a module

setModuleSize(float $value) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setModuleSize()

Parameters

$value

float

Exceptions

\Zend\Barcode\Renderer\Exception\OutOfRangeException

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set renderer state from options array

setOptions(array $options) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setOptions()

Parameters

$options

array

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set renderer namespace for autoloading

setRendererNamespace(string $namespace) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setRendererNamespace()

Parameters

$namespace

string

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set an image resource to draw the barcode inside

setResource(resource $image) : \Zend\Barcode\Renderer\Image

Parameters

$image

resource

Exceptions

\Zend\Barcode\Renderer\Exception\InvalidArgumentException

Returns

\Zend\Barcode\Renderer\Image

Manually adjust top position

setTopOffset(integer $value) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setTopOffset()

Parameters

$value

integer

Exceptions

\Zend\Barcode\Renderer\Exception\OutOfRangeException

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set whether background should be transparent Will work for SVG and Image (png and gif only)

setTransparentBackground($bool) : \Zend\Barcode\Renderer\Image
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$bool

Returns

\Zend\Barcode\Renderer\Image

Vertical position of the barcode in the rendering resource

setVerticalPosition(string $value) : \Zend\Barcode\Renderer\AbstractRenderer
Inherited
inherited_from \Zend\Barcode\Renderer\RendererInterface::setVerticalPosition()

Parameters

$value

string

Exceptions

\Zend\Barcode\Renderer\Exception\UnexpectedValueException

Returns

\Zend\Barcode\Renderer\AbstractRenderer

Set barcode width

setWidth(mixed $value) : \Zend\Barcode\Renderer\Image
fluent This method is part of a fluent interface and will return the same instance

Parameters

$value

mixed

Exceptions

\Zend\Barcode\Renderer\Exception\OutOfRangeException

Returns

\Zend\Barcode\Renderer\Image

Calculate the left and top offset of the barcode in the rendering support

adjustPosition(float $supportHeight, float $supportWidth) : void
Inherited

Parameters

$supportHeight

float

$supportWidth

float

Check if a barcode object is correctly provided

checkBarcodeObject() : void
Inherited

Exceptions

\Zend\Barcode\Renderer\Exception\RuntimeException

Check barcode dimensions

checkDimensions() : void

Exceptions

\Zend\Barcode\Renderer\Exception\RuntimeException

Check barcode parameters

checkSpecificParams() : void
inherited_from \Zend\Barcode\Renderer\AbstractRenderer::checkSpecificParams()

Checking of parameters after all settings

checkSpecificParams() : void
Inherited

Draw a polygon in the image resource

drawPolygon(array $points, integer $color, boolean $filled = true
inherited_from \Zend\Barcode\Renderer\AbstractRenderer::drawPolygon()

Parameters

$points

array

$color

integer

$filled

boolean

Draw a polygon in the rendering resource

drawPolygon(array $points, integer $color, boolean $filled = true
Inherited

Parameters

$points

array

$color

integer

$filled

boolean

Draw a polygon in the image resource

drawText(string $text, float $size, array $position, string $font, integer $color, string $alignment = 'center', float|integer $orientation = 0
inherited_from \Zend\Barcode\Renderer\AbstractRenderer::drawText()

Parameters

$text

string

$size

float

$position

array

$font

string

$color

integer

$alignment

string

$orientation

floatinteger

Exceptions

\Zend\Barcode\Renderer\Exception\RuntimeException

Draw a polygon in the rendering resource

drawText(string $text, float $size, array $position, string $font, integer $color, string $alignment = 'center', float|integer $orientation = 0
Inherited

Parameters

$text

string

$size

float

$position

array

$font

string

$color

integer

$alignment

string

$orientation

floatinteger

Initialize the image resource

initRenderer() : void
inherited_from \Zend\Barcode\Renderer\AbstractRenderer::initRenderer()

Initialize the rendering resource

initRenderer() : void
Inherited

Sub process to draw the barcode instructions Needed by the automatic error rendering

drawInstructionList() 
Inherited

 Properties

 

List of authorized output format

$allowedImageType : array

Default

array('png', 'jpeg', 'gif')
 

Activate/Deactivate the automatic rendering of exception

$automaticRenderError : boolean

Default

false
 

Barcode object

$barcode : \Zend\Barcode\Object\ObjectInterface

Default

 

Horizontal position of the barcode in the rendering resource

$horizontalPosition : string

Default

'left'
 

Resource for the background color of the image

$imageBackgroundColor : integer

Default

null
 

Resource for the font and bars color of the image

$imageForeColor : integer

Default

null
 

Image format

$imageType : string

Default

'png'
 

Offset of the barcode from the left of the rendering resource

$leftOffset : integer

Default

0
 

Module size rendering

$moduleSize : float

Default

1
 

Namespace of the renderer for autoloading

$rendererNamespace : string

Default

'Zend\Barcode\Renderer'
 

Resource for the image

$resource : resource

Default

null
inherited_from \Zend\Barcode\Renderer\AbstractRenderer::resource
 

Drawing resource

$resource 

Default

 

Offset of the barcode from the top of the rendering resource

$topOffset : integer

Default

0
 

Show a transparent background

$transparentBackground : Boolean

Default

false
 

Renderer type

$type : string

Default

null
 

Height of the rendered image wanted by user

$userHeight : integer

Default

0
 

Width of the rendered image wanted by user

$userWidth : integer

Default

0
 

Vertical position of the barcode in the rendering resource

$verticalPosition : string

Default

'top'