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

Class for rendering the barcode in PDF resource. More...

Public Member Functions

 setResource (PdfDocument $pdf, $page=0)
 Set a PDF resource to draw the barcode inside.
 
 render ()
 Draw the barcode in the PDF, send headers and the PDF.
 
 widthForStringUsingFontSize ($text, $font, $fontSize)
 Calculate the width of a string: in case of using alignment parameter in drawText.
 
- 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

 checkSpecificParams ()
 Check renderer parameters.
 
 initRenderer ()
 Initialize the PDF 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 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

 $resource = null
 
 $page = 0
 
 $moduleSize = 0.5
 
- 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
 

Detailed Description

Class for rendering the barcode in PDF resource.

Member Function Documentation

checkSpecificParams ( )
protected

Check renderer parameters.

Returns
void
drawPolygon (   $points,
  $color,
  $filled = true 
)
protected

Draw a polygon in the rendering resource.

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

Draw a polygon in the rendering resource.

Parameters
string$text
float$size
array$position
string$font
int$color
string$alignment
float$orientation
initRenderer ( )
protected

Initialize the PDF resource.

Returns
void
render ( )

Draw the barcode in the PDF, send headers and the PDF.

Returns
mixed

Implements RendererInterface.

setResource ( PdfDocument  $pdf,
  $page = 0 
)

Set a PDF resource to draw the barcode inside.

Parameters
PdfDocument$pdf
int$page
Returns
Pdf
widthForStringUsingFontSize (   $text,
  $font,
  $fontSize 
)

Calculate the width of a string: in case of using alignment parameter in drawText.

Parameters
string$text
Font$font
float$fontSize
Returns
float

Member Data Documentation

$moduleSize = 0.5
protected
$page = 0
protected
$resource = null
protected