Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Pdf_Canvas Class Reference

Public Member Functions

 __construct ($width, $height)
 Object constructor.
 
 getResources ()
 Returns dictionaries of used resources.
 
 getContents ()
 Get drawing instructions stream.
 
 getHeight ()
 Return the height of this page in points.
 
 getWidth ()
 Return the width of this page in points.
 
- Public Member Functions inherited from Zend_Pdf_Canvas_Abstract
 drawCanvas (Zend_Pdf_Canvas_Interface $canvas, $x1, $y1, $x2=null, $y2=null)
 Draw a canvas at the specified location.
 
 setFillColor (Zend_Pdf_Color $color)
 Set fill color.
 
 setLineColor (Zend_Pdf_Color $color)
 Set line color.
 
 setLineWidth ($width)
 Set line width.
 
 setLineDashingPattern ($pattern, $phase=0)
 Set line dashing pattern.
 
 setFont (Zend_Pdf_Resource_Font $font, $fontSize)
 Set current font.
 
 setStyle (Zend_Pdf_Style $style)
 Set the style to use for future drawing operations on this page.
 
 getFont ()
 Get current font.
 
 getFontSize ()
 Get current font size.
 
 getStyle ()
 Return the style, applied to the page.
 
 saveGS ()
 Save the graphics state of this page.
 
 restoreGS ()
 Restore the graphics state that was saved with the last call to saveGS().
 
 setAlpha ($alpha, $mode= 'Normal')
 Set the transparancy.
 
 clipCircle ($x, $y, $radius, $startAngle=null, $endAngle=null)
 Intersect current clipping area with a circle.
 
 clipEllipse ($x1, $y1, $x2, $y2, $startAngle=null, $endAngle=null)
 Intersect current clipping area with a polygon.
 
 clipPolygon ($x, $y, $fillMethod=Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING)
 Intersect current clipping area with a polygon.
 
 clipRectangle ($x1, $y1, $x2, $y2)
 Intersect current clipping area with a rectangle.
 
 drawCircle ($x, $y, $radius, $param4=null, $param5=null, $param6=null)
 Draw a circle centered on x, y with a radius of radius.
 
 drawEllipse ($x1, $y1, $x2, $y2, $param5=null, $param6=null, $param7=null)
 Draw an ellipse inside the specified rectangle.
 
 drawImage (Zend_Pdf_Resource_Image $image, $x1, $y1, $x2, $y2)
 Draw an image at the specified position on the page.
 
 drawLayoutBox ($box, $x, $y)
 Draw a LayoutBox at the specified position on the page.
 
 drawLine ($x1, $y1, $x2, $y2)
 Draw a line from x1,y1 to x2,y2.
 
 drawPolygon ($x, $y, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE, $fillMethod=Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING)
 Draw a polygon.
 
 drawRectangle ($x1, $y1, $x2, $y2, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE)
 Draw a rectangle.
 
 drawRoundedRectangle ($x1, $y1, $x2, $y2, $radius, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE)
 Draw a rounded rectangle.
 
 drawText ($text, $x, $y, $charEncoding= '')
 Draw a line of text at the specified position.
 
 pathClose ()
 Close the path by drawing a straight line back to it's beginning.
 
 pathLine ($x, $y)
 Continue the open path in a straight line to the specified position.
 
 pathMove ($x, $y)
 Start a new path at the specified position.
 
 rotate ($x, $y, $angle)
 Rotate the page.
 
 scale ($xScale, $yScale)
 Scale coordination system.
 
 translate ($xShift, $yShift)
 Translate coordination system.
 
 skew ($x, $y, $xAngle, $yAngle)
 Translate coordination system.
 
 rawWrite ($data, $procSet=null)
 Writes the raw data to the page's content stream.
 

Protected Member Functions

 _addProcSet ($procSetName)
 Add procedure set to the canvas description.
 
 _attachResource ($type, Zend_Pdf_Resource $resource)
 Attach resource to the canvas.
 
- Protected Member Functions inherited from Zend_Pdf_Canvas_Abstract
 _addProcSet ($procSetName)
 Add procedureSet to the Page description.
 
 _attachResource ($type, Zend_Pdf_Resource $resource)
 Attach resource to the canvas.
 

Protected Attributes

 $_procSet = array()
 
 $_width
 
 $_height
 
 $_resources
 
- Protected Attributes inherited from Zend_Pdf_Canvas_Abstract
 $_contents = ''
 
 $_font = null
 
 $_fontSize
 
 $_style = null
 
 $_saveCount = 0
 

Constructor & Destructor Documentation

__construct (   $width,
  $height 
)

Object constructor.

Parameters
float$width
float$height

Member Function Documentation

_addProcSet (   $procSetName)
protected

Add procedure set to the canvas description.

Parameters
string$procSetName
_attachResource (   $type,
Zend_Pdf_Resource  $resource 
)
protected

Attach resource to the canvas.

Method returns a name of the resource which can be used as a resource reference within drawing instructions stream Allowed types: 'ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font', 'Properties'

Parameters
string$type
Zend_Pdf_Resource$resource
Returns
string
getContents ( )

Get drawing instructions stream.

It has to be returned as a PDF stream object to make it reusable.

Todo:
implementation

Implements Zend_Pdf_Canvas_Interface.

getHeight ( )

Return the height of this page in points.

Returns
float

Implements Zend_Pdf_Canvas_Interface.

getResources ( )

Returns dictionaries of used resources.

Used for canvas implementations interoperability

Structure of the returned array: array( <resTypeName> => array( <resName> => <Zend_Pdf_Resource object>="">, <resName> => <Zend_Pdf_Resource object>="">, <resName> => <Zend_Pdf_Resource object>="">, ... ), <resTypeName> => array( <resName> => <Zend_Pdf_Resource object>="">, <resName> => <Zend_Pdf_Resource object>="">, <resName> => <Zend_Pdf_Resource object>="">, ... ), ... 'ProcSet' => array() )

where ProcSet array is a list of used procedure sets names (strings). Allowed procedure set names: 'PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'

Implements Zend_Pdf_Canvas_Interface.

getWidth ( )

Return the width of this page in points.

Returns
float

Implements Zend_Pdf_Canvas_Interface.

Member Data Documentation

$_height
protected
$_procSet = array()
protected
$_resources
protected
Initial value:
= array('Font' => array(),
'XObject' => array(),
'ExtGState' => array())
$_width
protected