Barcode/Renderer/Image.php

Show: inherited
Table of Contents

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 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Barcode_Renderer_Image

Package: Zend\Barcode

Class for rendering the barcode as image

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

Propertyprotectedarray $_allowedImageType = array('png', 'jpeg', 'gif')

List of authorized output format

Default valuearray('png', 'jpeg', 'gif')Details
Type
array
Propertyprotectedboolean $_automaticRenderError = false
inherited

Activate/Deactivate the automatic rendering of exception

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_automaticRenderError
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_automaticRenderError  
Propertyprotected\Zend_Barcode_Object_ObjectAbstract $_barcode =
inherited

Barcode object

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_barcode
Propertyprotectedinteger $_horizontalPosition = 'left'
inherited

Horizontal position of the barcode in the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_horizontalPosition
Default value'left'Details
Type
integer
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_horizontalPosition  
Propertyprotectedinteger $_imageBackgroundColor = null

Resource for the background color of the image

Default valuenullDetails
Type
integer
Propertyprotectedinteger $_imageForeColor = null

Resource for the font and bars color of the image

Default valuenullDetails
Type
integer
Propertyprotectedstring $_imageType = 'png'

Image format

Default value'png'Details
Type
string
Propertyprotectedinteger $_leftOffset = 0
inherited

Offset of the barcode from the left of the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_leftOffset
Default value0Details
Type
integer
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_leftOffset  
Propertyprotectedfloat $_moduleSize = 1
inherited

Module size rendering

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_moduleSize
Default value1Details
Type
float
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_moduleSize  
Propertyprotectedstring $_rendererNamespace = 'Zend_Barcode_Renderer'
inherited

Namespace of the renderer for autoloading

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_rendererNamespace
Default value'Zend_Barcode_Renderer'Details
Type
string
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_rendererNamespace  
Propertyprotectedresource $_resource = null

Resource for the image

Default valuenullDetails
Type
resource
Propertyprotectedinteger $_topOffset = 0
inherited

Offset of the barcode from the top of the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_topOffset
Default value0Details
Type
integer
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_topOffset  
Propertyprotectedstring $_type = null
inherited

Renderer type

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_type
Default valuenullDetails
Type
string
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_type  
Propertyprotectedinteger $_userHeight = 0

Height of the rendered image wanted by user

Default value0Details
Type
integer
Propertyprotectedinteger $_userWidth = 0

Width of the rendered image wanted by user

Default value0Details
Type
integer
Propertyprotectedinteger $_verticalPosition = 'top'
inherited

Vertical position of the barcode in the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::$$_verticalPosition
Default value'top'Details
Type
integer
Inherited_from
\Zend_Barcode_Renderer_RendererAbstract::$$_verticalPosition  

Methods

methodpublic__construct(array | \Zend_Config $options = null) : void

Constructor

Parameters
Name Type Description
$options array | \Zend_Config
methodprotected_adjustPosition(float $supportHeight, float $supportWidth) : void
inherited

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

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::_adjustPosition()
Parameters
Name Type Description
$supportHeight float
$supportWidth float
methodprotected_checkBarcodeObject() : void
inherited

Check if a barcode object is correctly provided

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::_checkBarcodeObject()
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodprotected_checkDimensions() : void

Check barcode dimensions

methodprotected_checkParams() : void

Check barcode parameters

methodprivate_drawInstructionList() : void
inherited

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

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::_drawInstructionList()
methodprotected_drawPolygon(array $points, integer $color, boolean $filled = true) : void

Draw a polygon in the image resource

Parameters
Name Type Description
$points array
$color integer
$filled boolean
methodprotected_drawText(string $text, float $size, array $position, string $font, integer $color, string $alignment = 'center', float $orientation = 0) : void

Draw a polygon in the image resource

Parameters
Name Type Description
$text string
$size float
$position array
$font string
$color integer
$alignment string
$orientation float
methodprotected_initRenderer() : void

Initialize the image resource

methodpubliccheckParams() : boolean
inherited

Checking of parameters after all settings

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::checkParams()
Returns
Type Description
boolean
methodpublicdraw() : mixed
inherited

Draw the barcode in the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::draw()
Returns
Type Description
mixed
methodpublicgetAutomaticRenderError() : boolean
inherited

Retrieve the automatic rendering of exception

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getAutomaticRenderError()
Returns
Type Description
boolean
methodpublicgetBarcode() : \Zend_Barcode_Object
inherited

Retrieve the barcode object

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getBarcode()
Returns
Type Description
\Zend_Barcode_Object
methodpublicgetHeight() : int

Get barcode height

Returns
Type Description
int
methodpublicgetHorizontalPosition() : string
inherited

Horizontal position of the barcode in the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getHorizontalPosition()
Returns
Type Description
string
methodpublicgetImageType() : string

Retrieve the image type to produce

Returns
Type Description
string
methodpublicgetLeftOffset() : integer
inherited

Retrieve vertical adjustment

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getLeftOffset()
Returns
Type Description
integer
methodpublicgetModuleSize() : float
inherited

Set the size of a module

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getModuleSize()
Returns
Type Description
float
methodpublicgetRendererNamespace() : string
inherited

Retrieve renderer namespace

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getRendererNamespace()
Returns
Type Description
string
methodpublicgetTopOffset() : integer
inherited

Retrieve vertical adjustment

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getTopOffset()
Returns
Type Description
integer
methodpublicgetType() : string
inherited

Retrieve renderer type

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getType()
Returns
Type Description
string
methodpublicgetVerticalPosition() : string
inherited

Vertical position of the barcode in the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::getVerticalPosition()
Returns
Type Description
string
methodpublicgetWidth() : int

Get barcode width

Returns
Type Description
int
methodpublicrender() : mixed

Draw and render the barcode with correct headers

Returns
Type Description
mixed
methodpublicsetAutomaticRenderError(boolean $value) : void
inherited

Activate/Deactivate the automatic rendering of exception

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setAutomaticRenderError()
Parameters
Name Type Description
$value boolean
methodpublicsetBarcode(\Zend_Barcode_Object $barcode) : \Zend_Barcode_Renderer
inherited

Set the barcode object

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setBarcode()
Parameters
Name Type Description
$barcode \Zend_Barcode_Object
Returns
Type Description
\Zend_Barcode_Renderer
methodpublicsetConfig(\Zend_Config $config) : \Zend_Renderer_Object
inherited

Set renderer state from config object

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setConfig()
Parameters
Name Type Description
$config \Zend_Config
Returns
Type Description
\Zend_Renderer_Object
methodpublicsetHeight(null | integer $value) : \Zend_Image_Barcode_Abstract

Set height of the result image

Parameters
Name Type Description
$value null | integer
Returns
Type Description
\Zend_Image_Barcode_Abstract
Throws
Exception Description
\Zend_Image_Barcode_Exception
methodpublicsetHorizontalPosition(string $value) : \Zend_Barcode_Renderer
inherited

Horizontal position of the barcode in the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setHorizontalPosition()
Parameters
Name Type Description
$value string
Returns
Type Description
\Zend_Barcode_Renderer
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodpublicsetImageType(string $value) : \Zend_Barcode_RendererAbstract

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

Parameters
Name Type Description
$value string
Returns
Type Description
\Zend_Barcode_RendererAbstract
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodpublicsetLeftOffset(integer $value) : \Zend_Barcode_Renderer
inherited

Manually adjust left position

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setLeftOffset()
Parameters
Name Type Description
$value integer
Returns
Type Description
\Zend_Barcode_Renderer
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodpublicsetModuleSize(float $value) : \Zend_Barcode_Renderer
inherited

Set the size of a module

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setModuleSize()
Parameters
Name Type Description
$value float
Returns
Type Description
\Zend_Barcode_Renderer
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodpublicsetOptions(array $options) : \Zend_Renderer_Object
inherited

Set renderer state from options array

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setOptions()
Parameters
Name Type Description
$options array
Returns
Type Description
\Zend_Renderer_Object
methodpublicsetRendererNamespace(string $namespace) : \Zend_Renderer_Object
inherited

Set renderer namespace for autoloading

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setRendererNamespace()
Parameters
Name Type Description
$namespace string
Returns
Type Description
\Zend_Renderer_Object
methodpublicsetResource( $image) : \Zend_Barcode_Renderer

Set an image resource to draw the barcode inside

Parameters
Name Type Description
$image
Returns
Type Description
\Zend_Barcode_Renderer
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodpublicsetTopOffset(integer $value) : \Zend_Barcode_Renderer
inherited

Manually adjust top position

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setTopOffset()
Parameters
Name Type Description
$value integer
Returns
Type Description
\Zend_Barcode_Renderer
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodpublicsetVerticalPosition(string $value) : \Zend_Barcode_Renderer
inherited

Vertical position of the barcode in the rendering resource

Inherited from: \Zend_Barcode_Renderer_RendererAbstract::setVerticalPosition()
Parameters
Name Type Description
$value string
Returns
Type Description
\Zend_Barcode_Renderer
Throws
Exception Description
\Zend_Barcode_Renderer_Exception
methodpublicsetWidth(mixed $value) : void

Set barcode width

Parameters
Name Type Description
$value mixed
Documentation was generated by phpDocumentor 2.0.0a8.