Zend Framework  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AbstractRenderer Class Reference

Class for rendering the barcode. More...

Public Member Functions

 __construct ($options=null)
 Constructor.
 
 setOptions ($options)
 Set renderer state from options array.
 
 setRendererNamespace ($namespace)
 Set renderer namespace for autoloading.
 
 getRendererNamespace ()
 Retrieve renderer namespace.
 
 setTransparentBackground ($bool)
 Set whether background should be transparent Will work for SVG and Image (png and gif only)
 
 getTransparentBackground ()
 
 getType ()
 Retrieve renderer type.
 
 setTopOffset ($value)
 Manually adjust top position.
 
 getTopOffset ()
 Retrieve vertical adjustment.
 
 setLeftOffset ($value)
 Manually adjust left position.
 
 getLeftOffset ()
 Retrieve vertical adjustment.
 
 setAutomaticRenderError ($value)
 Activate/Deactivate the automatic rendering of exception.
 
 setHorizontalPosition ($value)
 Horizontal position of the barcode in the rendering resource.
 
 getHorizontalPosition ()
 Horizontal position of the barcode in the rendering resource.
 
 setVerticalPosition ($value)
 Vertical position of the barcode in the rendering resource.
 
 getVerticalPosition ()
 Vertical position of the barcode in the rendering resource.
 
 setModuleSize ($value)
 Set the size of a module.
 
 getModuleSize ()
 Set the size of a module.
 
 getAutomaticRenderError ()
 Retrieve the automatic rendering of exception.
 
 setBarcode (Object\ObjectInterface $barcode)
 Set the barcode object.
 
 getBarcode ()
 Retrieve the barcode object.
 
 checkParams ()
 Checking of parameters after all settings.
 
 draw ()
 Draw the barcode in the rendering resource.
 
- Public Member Functions inherited from RendererInterface
 setBarcode (ObjectInterface $barcode)
 Set the barcode object.
 
 render ()
 Render the resource by sending headers and drawed resource.
 

Protected Member Functions

 checkBarcodeObject ()
 Check if a barcode object is correctly provided.
 
 adjustPosition ($supportHeight, $supportWidth)
 Calculate the left and top offset of the barcode in the rendering support.
 
 checkSpecificParams ()
 Checking of parameters after all settings.
 
 initRenderer ()
 Initialize the rendering resource.
 
 drawPolygon ($points, $color, $filled=true)
 Draw a polygon in the rendering resource.
 
 drawText ($text, $size, $position, $font, $color, $alignment= 'center', $orientation=0)
 Draw a polygon in the rendering resource.
 

Protected Attributes

 $rendererNamespace = 'Zend\Barcode\Renderer'
 
 $type = null
 
 $automaticRenderError = false
 
 $topOffset = 0
 
 $leftOffset = 0
 
 $horizontalPosition = 'left'
 
 $verticalPosition = 'top'
 
 $moduleSize = 1
 
 $barcode
 
 $resource
 Drawing resource.
 
 $transparentBackground = false
 

Detailed Description

Class for rendering the barcode.

Constructor & Destructor Documentation

__construct (   $options = null)

Constructor.

Parameters
array | Traversable$options

Implements RendererInterface.

Member Function Documentation

adjustPosition (   $supportHeight,
  $supportWidth 
)
protected

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

Parameters
float$supportHeight
float$supportWidth
Returns
void
checkBarcodeObject ( )
protected

Check if a barcode object is correctly provided.

Returns
void
Exceptions
Exception\RuntimeException
checkParams ( )

Checking of parameters after all settings.

Returns
bool

Implements RendererInterface.

checkSpecificParams ( )
abstractprotected

Checking of parameters after all settings.

Returns
void
draw ( )

Draw the barcode in the rendering resource.

Exceptions
BarcodeException\ExceptionInterface
Returns
mixed

Implements RendererInterface.

drawPolygon (   $points,
  $color,
  $filled = true 
)
abstractprotected

Draw a polygon in the rendering resource.

Parameters
array$points
int$color
bool$filled
drawText (   $text,
  $size,
  $position,
  $font,
  $color,
  $alignment = 'center',
  $orientation = 0 
)
abstractprotected

Draw a polygon in the rendering resource.

Parameters
string$text
float$size
array$position
string$font
int$color
string$alignment
float | int$orientation
getAutomaticRenderError ( )

Retrieve the automatic rendering of exception.

Returns
bool

Implements RendererInterface.

getBarcode ( )

Retrieve the barcode object.

Returns
Object

Implements RendererInterface.

getHorizontalPosition ( )

Horizontal position of the barcode in the rendering resource.

Returns
string

Implements RendererInterface.

getLeftOffset ( )

Retrieve vertical adjustment.

Returns
int

Implements RendererInterface.

getModuleSize ( )

Set the size of a module.

Returns
float

Implements RendererInterface.

getRendererNamespace ( )

Retrieve renderer namespace.

Returns
string

Implements RendererInterface.

getTopOffset ( )

Retrieve vertical adjustment.

Returns
int

Implements RendererInterface.

getTransparentBackground ( )
Returns
bool
getType ( )

Retrieve renderer type.

Returns
string

Implements RendererInterface.

getVerticalPosition ( )

Vertical position of the barcode in the rendering resource.

Returns
string

Implements RendererInterface.

initRenderer ( )
abstractprotected

Initialize the rendering resource.

Returns
void
setAutomaticRenderError (   $value)

Activate/Deactivate the automatic rendering of exception.

Parameters
bool$value
Returns
AbstractRenderer

Implements RendererInterface.

setBarcode ( Object\ObjectInterface  $barcode)

Set the barcode object.

Parameters
Object\ObjectInterface$barcode
Returns
AbstractRenderer
setHorizontalPosition (   $value)

Horizontal position of the barcode in the rendering resource.

Parameters
string$value
Returns
AbstractRenderer
Exceptions
Exception\UnexpectedValueException

Implements RendererInterface.

setLeftOffset (   $value)

Manually adjust left position.

Parameters
int$value
Returns
AbstractRenderer
Exceptions
Exception\OutOfRangeException

Implements RendererInterface.

setModuleSize (   $value)

Set the size of a module.

Parameters
float$value
Returns
AbstractRenderer
Exceptions
Exception\OutOfRangeException

Implements RendererInterface.

setOptions (   $options)

Set renderer state from options array.

Parameters
array$options
Returns
AbstractRenderer

Implements RendererInterface.

setRendererNamespace (   $namespace)

Set renderer namespace for autoloading.

Parameters
string$namespace
Returns
AbstractRenderer

Implements RendererInterface.

setTopOffset (   $value)

Manually adjust top position.

Parameters
int$value
Returns
AbstractRenderer
Exceptions
Exception\OutOfRangeException

Implements RendererInterface.

setTransparentBackground (   $bool)

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

Parameters
$bool
Returns
$this
setVerticalPosition (   $value)

Vertical position of the barcode in the rendering resource.

Parameters
string$value
Returns
AbstractRenderer
Exceptions
Exception\UnexpectedValueException

Implements RendererInterface.

Member Data Documentation

$automaticRenderError = false
protected
$barcode
protected
$horizontalPosition = 'left'
protected
$leftOffset = 0
protected
$moduleSize = 1
protected
$rendererNamespace = 'Zend\Barcode\Renderer'
protected
$resource
protected

Drawing resource.

$topOffset = 0
protected
$transparentBackground = false
protected
$type = null
protected
$verticalPosition = 'top'
protected