Zend Framework
1.12
|
Public Member Functions | |
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. | |
![]() | |
getResources () | |
Returns dictionaries of used resources. | |
getContents () | |
Get drawing instructions stream. | |
getHeight () | |
Return canvas height. | |
getWidth () | |
Return canvas width. | |
Protected Member Functions | |
_addProcSet ($procSetName) | |
Add procedureSet to the Page description. | |
_attachResource ($type, Zend_Pdf_Resource $resource) | |
Attach resource to the canvas. | |
Protected Attributes | |
$_contents = '' | |
$_font = null | |
$_fontSize | |
$_style = null | |
$_saveCount = 0 | |
|
abstractprotected |
Add procedureSet to the Page description.
string | $procSetName |
|
abstractprotected |
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'
string | $type | |
Zend_Pdf_Resource | $resource |
clipCircle | ( | $x, | |
$y, | |||
$radius, | |||
$startAngle = null , |
|||
$endAngle = null |
|||
) |
Intersect current clipping area with a circle.
float | $x | |
float | $y | |
float | $radius | |
float | $startAngle | |
float | $endAngle |
Implements Zend_Pdf_Canvas_Interface.
clipEllipse | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2, | |||
$startAngle = null , |
|||
$endAngle = null |
|||
) |
Intersect current clipping area with a polygon.
Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle);
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 | |
float | $startAngle | |
float | $endAngle |
Implements Zend_Pdf_Canvas_Interface.
clipPolygon | ( | $x, | |
$y, | |||
$fillMethod = Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING |
|||
) |
Intersect current clipping area with a polygon.
array | $x | - array of float (the X co-ordinates of the vertices) |
array | $y | - array of float (the Y co-ordinates of the vertices) |
integer | $fillMethod |
Implements Zend_Pdf_Canvas_Interface.
clipRectangle | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2 | |||
) |
Intersect current clipping area with a rectangle.
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 |
Implements Zend_Pdf_Canvas_Interface.
drawCanvas | ( | Zend_Pdf_Canvas_Interface | $canvas, |
$x1, | |||
$y1, | |||
$x2 = null , |
|||
$y2 = null |
|||
) |
Draw a canvas at the specified location.
If upper right corner is not specified then canvas heght and width are used.
Zend_Pdf_Canvas_Interface | $canvas | |
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 |
Implements Zend_Pdf_Canvas_Interface.
drawCircle | ( | $x, | |
$y, | |||
$radius, | |||
$param4 = null , |
|||
$param5 = null , |
|||
$param6 = null |
|||
) |
Draw a circle centered on x, y with a radius of radius.
Method signatures: drawCircle($x, $y, $radius); drawCircle($x, $y, $radius, $fillType); drawCircle($x, $y, $radius, $startAngle, $endAngle); drawCircle($x, $y, $radius, $startAngle, $endAngle, $fillType);
It's not a really circle, because PDF supports only cubic Bezier curves. But _very_ good approximation. It differs from a real circle on a maximum 0.00026 radiuses (at PI/8, 3*PI/8, 5*PI/8, 7*PI/8, 9*PI/8, 11*PI/8, 13*PI/8 and 15*PI/8 angles). At 0, PI/4, PI/2, 3*PI/4, PI, 5*PI/4, 3*PI/2 and 7*PI/4 it's exactly a tangent to a circle.
float | $x | |
float | $y | |
float | $radius | |
mixed | $param4 | |
mixed | $param5 | |
mixed | $param6 |
Implements Zend_Pdf_Canvas_Interface.
drawEllipse | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2, | |||
$param5 = null , |
|||
$param6 = null , |
|||
$param7 = null |
|||
) |
Draw an ellipse inside the specified rectangle.
Method signatures: drawEllipse($x1, $y1, $x2, $y2); drawEllipse($x1, $y1, $x2, $y2, $fillType); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle); drawEllipse($x1, $y1, $x2, $y2, $startAngle, $endAngle, $fillType);
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 | |
mixed | $param5 | |
mixed | $param6 | |
mixed | $param7 |
Implements Zend_Pdf_Canvas_Interface.
drawImage | ( | Zend_Pdf_Resource_Image | $image, |
$x1, | |||
$y1, | |||
$x2, | |||
$y2 | |||
) |
Draw an image at the specified position on the page.
Zend_Pdf_Image | $image | |
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 |
Implements Zend_Pdf_Canvas_Interface.
drawLayoutBox | ( | $box, | |
$x, | |||
$y | |||
) |
Draw a LayoutBox at the specified position on the page.
Implements Zend_Pdf_Canvas_Interface.
drawLine | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2 | |||
) |
Draw a line from x1,y1 to x2,y2.
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 |
Implements Zend_Pdf_Canvas_Interface.
drawPolygon | ( | $x, | |
$y, | |||
$fillType = Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE , |
|||
$fillMethod = Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING |
|||
) |
Draw a polygon.
If $fillType is Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE or Zend_Pdf_Page::SHAPE_DRAW_FILL, then polygon is automatically closed. See detailed description of these methods in a PDF documentation (section 4.4.2 Path painting Operators, Filling)
array | $x | - array of float (the X co-ordinates of the vertices) |
array | $y | - array of float (the Y co-ordinates of the vertices) |
integer | $fillType | |
integer | $fillMethod |
Implements Zend_Pdf_Canvas_Interface.
drawRectangle | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2, | |||
$fillType = Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE |
|||
) |
Draw a rectangle.
Fill types: Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE - fill rectangle and stroke (default) Zend_Pdf_Page::SHAPE_DRAW_STROKE - stroke rectangle Zend_Pdf_Page::SHAPE_DRAW_FILL - fill rectangle
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 | |
integer | $fillType |
Implements Zend_Pdf_Canvas_Interface.
drawRoundedRectangle | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2, | |||
$radius, | |||
$fillType = Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE |
|||
) |
Draw a rounded rectangle.
Fill types: Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE - fill rectangle and stroke (default) Zend_Pdf_Page::SHAPE_DRAW_STROKE - stroke rectangle Zend_Pdf_Page::SHAPE_DRAW_FILL - fill rectangle
radius is an integer representing radius of the four corners, or an array of four integers representing the radius starting at top left, going clockwise
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 | |
integer | array | $radius | |
integer | $fillType |
Implements Zend_Pdf_Canvas_Interface.
drawText | ( | $text, | |
$x, | |||
$y, | |||
$charEncoding = '' |
|||
) |
Draw a line of text at the specified position.
string | $text | |
float | $x | |
float | $y | |
string | $charEncoding | (optional) Character encoding of source text. Defaults to current locale. |
Zend_Pdf_Exception |
Implements Zend_Pdf_Canvas_Interface.
getFont | ( | ) |
getFontSize | ( | ) |
getStyle | ( | ) |
pathClose | ( | ) |
Close the path by drawing a straight line back to it's beginning.
Implements Zend_Pdf_Canvas_Interface.
pathLine | ( | $x, | |
$y | |||
) |
Continue the open path in a straight line to the specified position.
Implements Zend_Pdf_Canvas_Interface.
pathMove | ( | $x, | |
$y | |||
) |
Start a new path at the specified position.
If a path has already been started, move the cursor without drawing a line.
Implements Zend_Pdf_Canvas_Interface.
rawWrite | ( | $data, | |
$procSet = null |
|||
) |
Writes the raw data to the page's content stream.
Be sure to consult the PDF reference to ensure your syntax is correct. No attempt is made to ensure the validity of the stream data.
string | $data | |
string | $procSet | (optional) Name of ProcSet to add. |
Implements Zend_Pdf_Canvas_Interface.
restoreGS | ( | ) |
Restore the graphics state that was saved with the last call to saveGS().
Zend_Pdf_Exception | - if there is no previously saved state |
rotate | ( | $x, | |
$y, | |||
$angle | |||
) |
Rotate the page.
float | $x | - the X co-ordinate of rotation point |
float | $y | - the Y co-ordinate of rotation point |
float | $angle | - rotation angle |
Implements Zend_Pdf_Canvas_Interface.
saveGS | ( | ) |
Save the graphics state of this page.
This takes a snapshot of the currently applied style, position, clipping area and any rotation/translation/scaling that has been applied.
Zend_Pdf_Exception | - if a save is performed with an open path |
Implements Zend_Pdf_Canvas_Interface.
scale | ( | $xScale, | |
$yScale | |||
) |
Scale coordination system.
float | $xScale | - X dimention scale factor |
float | $yScale | - Y dimention scale factor |
Implements Zend_Pdf_Canvas_Interface.
setAlpha | ( | $alpha, | |
$mode = 'Normal' |
|||
) |
Set the transparancy.
$alpha == 0 - transparent $alpha == 1 - opaque
Transparency modes, supported by PDF: Normal (default), Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion
float | $alpha | |
string | $mode |
Implements Zend_Pdf_Canvas_Interface.
setFillColor | ( | Zend_Pdf_Color | $color | ) |
Set fill color.
Zend_Pdf_Color | $color |
Implements Zend_Pdf_Canvas_Interface.
setFont | ( | Zend_Pdf_Resource_Font | $font, |
$fontSize | |||
) |
Set current font.
Zend_Pdf_Resource_Font | $font | |
float | $fontSize |
Implements Zend_Pdf_Canvas_Interface.
setLineColor | ( | Zend_Pdf_Color | $color | ) |
Set line color.
Zend_Pdf_Color | $color |
Implements Zend_Pdf_Canvas_Interface.
setLineDashingPattern | ( | $pattern, | |
$phase = 0 |
|||
) |
Set line dashing pattern.
Pattern is an array of floats: array(on_length, off_length, on_length, off_length, ...) or Zend_Pdf_Page::LINE_DASHING_SOLID constant Phase is shift from the beginning of line.
mixed | $pattern | |
array | $phase |
Implements Zend_Pdf_Canvas_Interface.
setLineWidth | ( | $width | ) |
Set line width.
float | $width |
Implements Zend_Pdf_Canvas_Interface.
setStyle | ( | Zend_Pdf_Style | $style | ) |
Set the style to use for future drawing operations on this page.
Zend_Pdf_Style | $style |
Implements Zend_Pdf_Canvas_Interface.
skew | ( | $x, | |
$y, | |||
$xAngle, | |||
$yAngle | |||
) |
Translate coordination system.
float | $x | - the X co-ordinate of axis skew point |
float | $y | - the Y co-ordinate of axis skew point |
float | $xAngle | - X axis skew angle |
float | $yAngle | - Y axis skew angle |
Implements Zend_Pdf_Canvas_Interface.
translate | ( | $xShift, | |
$yShift | |||
) |
Translate coordination system.
float | $xShift | - X coordinate shift |
float | $yShift | - Y coordinate shift |
Implements Zend_Pdf_Canvas_Interface.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |