Class for rendering the barcode as svg

package Default
inherited_from \Zend\Barcode\Renderer\AbstractRenderer

 Methods

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() : \DOMDocument
inherited_from \Zend\Barcode\Renderer\AbstractRenderer::draw()

Returns

\DOMDocument

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

Parameters

$value

nullinteger

Exceptions

\Zend\Barcode\Renderer\Exception\OutOfRangeException

Returns

\Zend\Barcode\Renderer\Svg

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

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(\DOMDocument $svg) : \Zend\Barcode\Renderer\Svg

Parameters

$svg

\DOMDocument

Returns

\Zend\Barcode\Renderer\Svg

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\Svg
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$bool

Returns

\Zend\Barcode\Renderer\Svg

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

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

Append a new DOMElement to the root element

appendRootElement(string $tagName, array $attributes = array(), string $textContent = null

Parameters

$tagName

string

$attributes

array

$textContent

string

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

Create DOMElement

createElement(string $tagName, array $attributes = array(), string $textContent = null) : \DOMElement

Parameters

$tagName

string

$attributes

array

$textContent

string

Returns

\DOMElement

Draw a polygon in the svg 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 svg resource

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

Parameters

$text

string

$size

float

$position

array

$font

string

$color

integer

$alignment

string

$orientation

float

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

readRootElement()

readRootElement() 

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

drawInstructionList() 
Inherited

 Properties

 

Activate/Deactivate the automatic rendering of exception

$automaticRenderError : boolean

Default

false
 

Barcode object

$barcode : \Zend\Barcode\Object\ObjectInterface

Default

 

Flag to determime if drawPolygon has been run once already

$drawPolygonExecuted : boolean

Default

false
 

Horizontal position of the barcode in the rendering resource

$horizontalPosition : string

Default

'left'
 

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 : \DOMDocument

Default

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

Drawing resource

$resource 

Default

 

Root element of the XML structure

$rootElement : \DOMElement

Default

null
 

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'