Barcode/Renderer/Svg.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Barcode
- Subpackage
- Renderer
- Version
- $Id: Image.php 20366 2010-01-18 03:56:52Z ralph $
\Zend_Barcode_Renderer_Svg
Class for rendering the barcode as svg
- Parent(s)
- \Zend_Barcode_Renderer_RendererAbstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

boolean $_automaticRenderError = falseActivate/Deactivate the automatic rendering of exception
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_automaticRenderErrorfalseDetails- Type
- boolean
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_automaticRenderError

integer $_horizontalPosition = 'left'Horizontal position of the barcode in the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_horizontalPosition'left'Details- Type
- integer
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_horizontalPosition

integer $_leftOffset = 0Offset of the barcode from the left of the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_leftOffset0Details- Type
- integer
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_leftOffset

float $_moduleSize = 1Module size rendering
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_moduleSize1Details- Type
- float
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_moduleSize

string $_rendererNamespace = 'Zend_Barcode_Renderer'Namespace of the renderer for autoloading
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_rendererNamespace'Zend_Barcode_Renderer'Details- Type
- string
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_rendererNamespace

\DOMElement $_rootElement = nullRoot element of the XML structure
nullDetails- Type
- \DOMElement

integer $_topOffset = 0Offset of the barcode from the top of the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_topOffset0Details- Type
- integer
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_topOffset

string $_type = null
nullDetails- Type
- string
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_type

integer $_userHeight = 0Height of the rendered image wanted by user
0Details- Type
- integer

integer $_userWidth = 0Width of the rendered image wanted by user
0Details- Type
- integer

integer $_verticalPosition = 'top'Vertical position of the barcode in the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_verticalPosition'top'Details- Type
- integer
- Inherited_from
- \Zend_Barcode_Renderer_RendererAbstract::$$_verticalPosition
Methods

__construct(array | \Zend_Config $options = null) : void
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config |

_adjustPosition(float $supportHeight, float $supportWidth) : voidCalculate the left and top offset of the barcode in the rendering support
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::_adjustPosition()| Name | Type | Description |
|---|---|---|
| $supportHeight | float | |
| $supportWidth | float |

_appendRootElement(string $tagName, array $attributes = array(), string $textContent = null) : voidAppend a new DOMElement to the root element
| Name | Type | Description |
|---|---|---|
| $tagName | string | |
| $attributes | array | |
| $textContent | string |

_checkBarcodeObject() : voidCheck if a barcode object is correctly provided
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::_checkBarcodeObject()| Exception | Description |
|---|---|
| \Zend_Barcode_Renderer_Exception |

_createElement(string $tagName, array $attributes = array(), string $textContent = null) : \DOMElementCreate DOMElement
| Name | Type | Description |
|---|---|---|
| $tagName | string | |
| $attributes | array | |
| $textContent | string |
| Type | Description |
|---|---|
| \DOMElement |

_drawInstructionList() : voidSub process to draw the barcode instructions Needed by the automatic error rendering
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::_drawInstructionList()
_drawPolygon(array $points, integer $color, boolean $filled = true) : voidDraw a polygon in the svg resource
| Name | Type | Description |
|---|---|---|
| $points | array | |
| $color | integer | |
| $filled | boolean |

_drawText(string $text, float $size, array $position, string $font, integer $color, string $alignment = 'center', float $orientation = 0) : voidDraw a polygon in the svg resource
| Name | Type | Description |
|---|---|---|
| $text | string | |
| $size | float | |
| $position | array | |
| $font | string | |
| $color | integer | |
| $alignment | string | |
| $orientation | float |

checkParams() : booleanChecking of parameters after all settings
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::checkParams()| Type | Description |
|---|---|
| boolean |

getAutomaticRenderError() : booleanRetrieve the automatic rendering of exception
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getAutomaticRenderError()| Type | Description |
|---|---|
| boolean |

getBarcode() : \Zend_Barcode_ObjectRetrieve the barcode object
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getBarcode()| Type | Description |
|---|---|
| \Zend_Barcode_Object |

getHorizontalPosition() : stringHorizontal position of the barcode in the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getHorizontalPosition()| Type | Description |
|---|---|
| string |

getLeftOffset() : integerRetrieve vertical adjustment
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getLeftOffset()| Type | Description |
|---|---|
| integer |

getModuleSize() : floatSet the size of a module
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getModuleSize()| Type | Description |
|---|---|
| float |

getRendererNamespace() : stringRetrieve renderer namespace
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getRendererNamespace()| Type | Description |
|---|---|
| string |

getTopOffset() : integerRetrieve vertical adjustment
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getTopOffset()| Type | Description |
|---|---|
| integer |

getVerticalPosition() : stringVertical position of the barcode in the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getVerticalPosition()| Type | Description |
|---|---|
| string |

setAutomaticRenderError(boolean $value) : voidActivate/Deactivate the automatic rendering of exception
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setAutomaticRenderError()| Name | Type | Description |
|---|---|---|
| $value | boolean |

setBarcode(\Zend_Barcode_Object $barcode) : \Zend_Barcode_RendererSet the barcode object
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setBarcode()| Name | Type | Description |
|---|---|---|
| $barcode | \Zend_Barcode_Object |
| Type | Description |
|---|---|
| \Zend_Barcode_Renderer |

setConfig(\Zend_Config $config) : \Zend_Renderer_ObjectSet renderer state from config object
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setConfig()| Name | Type | Description |
|---|---|---|
| $config | \Zend_Config |
| Type | Description |
|---|---|
| \Zend_Renderer_Object |

setHeight(null | integer $value) : \Zend_Image_Barcode_AbstractSet height of the result image
| Name | Type | Description |
|---|---|---|
| $value | null | integer |
| Type | Description |
|---|---|
| \Zend_Image_Barcode_Abstract |
| Exception | Description |
|---|---|
| \Zend_Image_Barcode_Exception |

setHorizontalPosition(string $value) : \Zend_Barcode_RendererHorizontal position of the barcode in the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setHorizontalPosition()| Name | Type | Description |
|---|---|---|
| $value | string |
| Type | Description |
|---|---|
| \Zend_Barcode_Renderer |
| Exception | Description |
|---|---|
| \Zend_Barcode_Renderer_Exception |

setLeftOffset(integer $value) : \Zend_Barcode_RendererManually adjust left position
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setLeftOffset()| Name | Type | Description |
|---|---|---|
| $value | integer |
| Type | Description |
|---|---|
| \Zend_Barcode_Renderer |
| Exception | Description |
|---|---|
| \Zend_Barcode_Renderer_Exception |

setModuleSize(float $value) : \Zend_Barcode_RendererSet the size of a module
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setModuleSize()| Name | Type | Description |
|---|---|---|
| $value | float |
| Type | Description |
|---|---|
| \Zend_Barcode_Renderer |
| Exception | Description |
|---|---|
| \Zend_Barcode_Renderer_Exception |

setOptions(array $options) : \Zend_Renderer_ObjectSet renderer state from options array
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setOptions()| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Renderer_Object |

setRendererNamespace(string $namespace) : \Zend_Renderer_ObjectSet renderer namespace for autoloading
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setRendererNamespace()| Name | Type | Description |
|---|---|---|
| $namespace | string |
| Type | Description |
|---|---|
| \Zend_Renderer_Object |

setResource( $svg) : \Zend_Barcode_RendererSet an image resource to draw the barcode inside
| Name | Type | Description |
|---|---|---|
| $svg |
| Type | Description |
|---|---|
| \Zend_Barcode_Renderer |
| Exception | Description |
|---|---|
| \Zend_Barcode_Renderer_Exception |

setTopOffset(integer $value) : \Zend_Barcode_RendererManually adjust top position
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setTopOffset()| Name | Type | Description |
|---|---|---|
| $value | integer |
| Type | Description |
|---|---|
| \Zend_Barcode_Renderer |
| Exception | Description |
|---|---|
| \Zend_Barcode_Renderer_Exception |

setVerticalPosition(string $value) : \Zend_Barcode_RendererVertical position of the barcode in the rendering resource
Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setVerticalPosition()| Name | Type | Description |
|---|---|---|
| $value | string |
| Type | Description |
|---|---|
| \Zend_Barcode_Renderer |
| Exception | Description |
|---|---|
| \Zend_Barcode_Renderer_Exception |