Zend Framework
3.0
|
Class for rendering the barcode as image. More...
Public Member Functions | |
__construct ($options=null) | |
Constructor. | |
setHeight ($value) | |
Set height of the result image. | |
getHeight () | |
Get barcode height. | |
setWidth ($value) | |
Set barcode width. | |
getWidth () | |
Get barcode width. | |
setResource ($image) | |
Set an image resource to draw the barcode inside. | |
setImageType ($value) | |
Set the image type to produce (png, jpeg, gif) | |
getImageType () | |
Retrieve the image type to produce. | |
render () | |
Draw and render the barcode with correct headers. | |
Public Member Functions inherited from AbstractRenderer | |
__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. | |
Protected Member Functions | |
initRenderer () | |
Initialize the image resource. | |
checkSpecificParams () | |
Check barcode parameters. | |
checkDimensions () | |
Check barcode dimensions. | |
drawPolygon ($points, $color, $filled=true) | |
Draw a polygon in the image resource. | |
drawText ($text, $size, $position, $font, $color, $alignment= 'center', $orientation=0) | |
Draw a polygon in the image resource. | |
Protected Member Functions inherited from AbstractRenderer | |
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 | |
$allowedImageType | |
$imageType = 'png' | |
$resource = null | |
$imageForeColor = null | |
$imageBackgroundColor = null | |
$userHeight = 0 | |
$userWidth = 0 | |
Protected Attributes inherited from AbstractRenderer | |
$rendererNamespace = 'Zend\Barcode\Renderer' | |
$type = null | |
$automaticRenderError = false | |
$topOffset = 0 | |
$leftOffset = 0 | |
$horizontalPosition = 'left' | |
$verticalPosition = 'top' | |
$moduleSize = 1 | |
$barcode | |
$resource | |
Drawing resource. | |
$transparentBackground = false | |
Class for rendering the barcode as image.
__construct | ( | $options = null | ) |
Constructor.
array | \Traversable | $options |
RendererCreationException |
Implements RendererInterface.
|
protected |
Check barcode dimensions.
Exception\RuntimeException |
|
protected |
Check barcode parameters.
|
protected |
Draw a polygon in the image resource.
array | $points | |
int | $color | |
bool | $filled |
|
protected |
Draw a polygon in the image resource.
string | $text | |
float | $size | |
array | $position | |
string | $font | |
int | $color | |
string | $alignment | |
float | int | $orientation |
Exception\RuntimeException |
imagestring() doesn't allow orientation, if orientation needed: a TTF font is required. Throwing an exception here, allow to use automaticRenderError to inform user of the problem instead of simply not drawing the text
getHeight | ( | ) |
Get barcode height.
getImageType | ( | ) |
Retrieve the image type to produce.
getWidth | ( | ) |
Get barcode width.
|
protected |
Initialize the image resource.
render | ( | ) |
setHeight | ( | $value | ) |
Set height of the result image.
null | int | $value |
Exception\OutOfRangeException |
setImageType | ( | $value | ) |
Set the image type to produce (png, jpeg, gif)
string | $value |
Exception\InvalidArgumentException |
setResource | ( | $image | ) |
Set an image resource to draw the barcode inside.
resource | $image |
Exception\InvalidArgumentException |
setWidth | ( | $value | ) |
Set barcode width.
mixed | $value |
Exception\OutOfRangeException |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |