Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Pdf_Canvas_Interface Interface Reference
Inheritance diagram for Zend_Pdf_Canvas_Interface:
Zend_Pdf_Canvas_Abstract Zend_Pdf_Canvas Zend_Pdf_Page

Public Member Functions

 getResources ()
 
 getContents ()
 
 getHeight ()
 
 getWidth ()
 
 drawCanvas (Zend_Pdf_Canvas_Interface $canvas, $x1, $y1, $x2=null, $y2=null)
 
 setFillColor (Zend_Pdf_Color $color)
 
 setLineColor (Zend_Pdf_Color $color)
 
 setLineWidth ($width)
 
 setLineDashingPattern ($pattern, $phase=0)
 
 setFont (Zend_Pdf_Resource_Font $font, $fontSize)
 
 setStyle (Zend_Pdf_Style $style)
 
 getFont ()
 
 getFontSize ()
 
 getStyle ()
 
 saveGS ()
 
 setAlpha ($alpha, $mode='Normal')
 
 clipCircle ($x, $y, $radius, $startAngle=null, $endAngle=null)
 
 clipEllipse ($x1, $y1, $x2, $y2, $startAngle=null, $endAngle=null)
 
 clipPolygon ($x, $y, $fillMethod=Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING)
 
 clipRectangle ($x1, $y1, $x2, $y2)
 
 drawCircle ($x, $y, $radius, $param4=null, $param5=null, $param6=null)
 
 drawEllipse ($x1, $y1, $x2, $y2, $param5=null, $param6=null, $param7=null)
 
 drawImage (Zend_Pdf_Resource_Image $image, $x1, $y1, $x2, $y2)
 
 drawLayoutBox ($box, $x, $y)
 
 drawLine ($x1, $y1, $x2, $y2)
 
 drawPolygon ($x, $y, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE, $fillMethod=Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING)
 
 drawRectangle ($x1, $y1, $x2, $y2, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE)
 
 drawRoundedRectangle ($x1, $y1, $x2, $y2, $radius, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE)
 
 drawText ($text, $x, $y, $charEncoding='')
 
 pathClose ()
 
 pathLine ($x, $y)
 
 pathMove ($x, $y)
 
 rotate ($x, $y, $angle)
 
 scale ($xScale, $yScale)
 
 translate ($xShift, $yShift)
 
 skew ($x, $y, $xAngle, $yAngle)
 
 rawWrite ($data, $procSet=null)
 

Detailed Description

Definition at line 31 of file Interface.php.

Member Function Documentation

◆ clipCircle()

clipCircle (   $x,
  $y,
  $radius,
  $startAngle = null,
  $endAngle = null 
)

Intersect current clipping area with a circle.

Parameters
float$x
float$y
float$radius
float$startAngle
float$endAngle
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ clipEllipse()

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);

Todo:
process special cases with $x2-$x1 == 0 or $y2-$y1 == 0
Parameters
float$x1
float$y1
float$x2
float$y2
float$startAngle
float$endAngle
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ clipPolygon()

clipPolygon (   $x,
  $y,
  $fillMethod = Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING 
)

Intersect current clipping area with a polygon.

Parameters
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
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ clipRectangle()

clipRectangle (   $x1,
  $y1,
  $x2,
  $y2 
)

Intersect current clipping area with a rectangle.

Parameters
float$x1
float$y1
float$x2
float$y2
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawCanvas()

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.

Parameters
Zend_Pdf_Canvas_Interface$canvas
float$x1
float$y1
float$x2
float$y2
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawCircle()

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.

Parameters
float$x
float$y
float$radius
mixed$param4
mixed$param5
mixed$param6
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawEllipse()

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);

Todo:
process special cases with $x2-$x1 == 0 or $y2-$y1 == 0
Parameters
float$x1
float$y1
float$x2
float$y2
mixed$param5
mixed$param6
mixed$param7
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawImage()

drawImage ( Zend_Pdf_Resource_Image  $image,
  $x1,
  $y1,
  $x2,
  $y2 
)

Draw an image at the specified position on the page.

Parameters
Zend_Pdf_Image$image
float$x1
float$y1
float$x2
float$y2
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawLayoutBox()

drawLayoutBox (   $box,
  $x,
  $y 
)

Draw a LayoutBox at the specified position on the page.

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawLine()

drawLine (   $x1,
  $y1,
  $x2,
  $y2 
)

Draw a line from x1,y1 to x2,y2.

Parameters
float$x1
float$y1
float$x2
float$y2
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawPolygon()

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)

Parameters
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
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawRectangle()

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

Parameters
float$x1
float$y1
float$x2
float$y2
integer$fillType
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawRoundedRectangle()

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

Parameters
float$x1
float$y1
float$x2
float$y2
integer | array$radius
integer$fillType
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ drawText()

drawText (   $text,
  $x,
  $y,
  $charEncoding = '' 
)

Draw a line of text at the specified position.

Parameters
string$text
float$x
float$y
string$charEncoding(optional) Character encoding of source text. Defaults to current locale.
Exceptions
Zend_Pdf_Exception
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ getContents()

getContents ( )

Get drawing instructions stream

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

Implemented in Zend_Pdf_Page, and Zend_Pdf_Canvas.

◆ getFont()

getFont ( )

Get current font.

Returns
Zend_Pdf_Resource_Font $font

Implemented in Zend_Pdf_Canvas_Abstract.

◆ getFontSize()

getFontSize ( )

Get current font size

Returns
float $fontSize

Implemented in Zend_Pdf_Canvas_Abstract.

◆ getHeight()

getHeight ( )

Return canvas height.

Returns
float

Implemented in Zend_Pdf_Page, and Zend_Pdf_Canvas.

◆ getResources()

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'

Implemented in Zend_Pdf_Page, and Zend_Pdf_Canvas.

◆ getStyle()

getStyle ( )

Return the style, applied to the page.

Returns
Zend_Pdf_Style|null

Implemented in Zend_Pdf_Canvas_Abstract.

◆ getWidth()

getWidth ( )

Return canvas width.

Returns
float

Implemented in Zend_Pdf_Page, and Zend_Pdf_Canvas.

◆ pathClose()

pathClose ( )

Close the path by drawing a straight line back to it's beginning.

Implemented in Zend_Pdf_Canvas_Abstract.

◆ pathLine()

pathLine (   $x,
  $y 
)

Continue the open path in a straight line to the specified position.

Implemented in Zend_Pdf_Canvas_Abstract.

◆ pathMove()

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.

Implemented in Zend_Pdf_Canvas_Abstract.

◆ rawWrite()

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.

Parameters
string$data
string$procSet(optional) Name of ProcSet to add.
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ rotate()

rotate (   $x,
  $y,
  $angle 
)

Rotate the page.

Parameters
float$x- the X co-ordinate of rotation point
float$y- the Y co-ordinate of rotation point
float$angle- rotation angle
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ saveGS()

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.

Exceptions
Zend_Pdf_Exception- if a save is performed with an open path
Returns
Zend_Pdf_Page

Implemented in Zend_Pdf_Canvas_Abstract.

◆ scale()

scale (   $xScale,
  $yScale 
)

Scale coordination system.

Parameters
float$xScale- X dimention scale factor
float$yScale- Y dimention scale factor
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ setAlpha()

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

Parameters
float$alpha
string$mode
Exceptions
Zend_Pdf_Exception
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ setFillColor()

setFillColor ( Zend_Pdf_Color  $color)

Set fill color.

Parameters
Zend_Pdf_Color$color
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ setFont()

setFont ( Zend_Pdf_Resource_Font  $font,
  $fontSize 
)

Set current font.

Parameters
Zend_Pdf_Resource_Font$font
float$fontSize
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ setLineColor()

setLineColor ( Zend_Pdf_Color  $color)

Set line color.

Parameters
Zend_Pdf_Color$color
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ setLineDashingPattern()

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.

Parameters
mixed$pattern
array$phase
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ setLineWidth()

setLineWidth (   $width)

Set line width.

Parameters
float$width
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ setStyle()

setStyle ( Zend_Pdf_Style  $style)

Set the style to use for future drawing operations on this page

Parameters
Zend_Pdf_Style$style
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ skew()

skew (   $x,
  $y,
  $xAngle,
  $yAngle 
)

Translate coordination system.

Parameters
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
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.

◆ translate()

translate (   $xShift,
  $yShift 
)

Translate coordination system.

Parameters
float$xShift- X coordinate shift
float$yShift- Y coordinate shift
Returns
Zend_Pdf_Canvas_Interface

Implemented in Zend_Pdf_Canvas_Abstract.


The documentation for this interface was generated from the following file: