Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
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) | |
Definition at line 31 of file Interface.php.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
clipRectangle | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2 | |||
) |
Intersect current clipping area with a rectangle.
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
drawLayoutBox | ( | $box, | |
$x, | |||
$y | |||
) |
Draw a LayoutBox at the specified position on the page.
Implemented in Zend_Pdf_Canvas_Abstract.
drawLine | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2 | |||
) |
Draw a line from x1,y1 to x2,y2.
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 | ( | ) |
getFontSize | ( | ) |
getHeight | ( | ) |
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 | ( | ) |
Return the style, applied to the page.
Implemented in Zend_Pdf_Canvas_Abstract.
getWidth | ( | ) |
pathClose | ( | ) |
Close the path by drawing a straight line back to it's beginning.
Implemented in Zend_Pdf_Canvas_Abstract.
pathLine | ( | $x, | |
$y | |||
) |
Continue the open path in a straight line to the specified position.
Implemented in Zend_Pdf_Canvas_Abstract.
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 | ( | $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. |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
scale | ( | $xScale, | |
$yScale | |||
) |
Scale coordination system.
float | $xScale | - X dimention scale factor |
float | $yScale | - Y dimention scale factor |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Zend_Pdf_Exception |
Implemented in Zend_Pdf_Canvas_Abstract.
setFillColor | ( | Zend_Pdf_Color | $color | ) |
Set fill color.
Zend_Pdf_Color | $color |
Implemented in Zend_Pdf_Canvas_Abstract.
setFont | ( | Zend_Pdf_Resource_Font | $font, |
$fontSize | |||
) |
Set current font.
Zend_Pdf_Resource_Font | $font | |
float | $fontSize |
Implemented in Zend_Pdf_Canvas_Abstract.
setLineColor | ( | Zend_Pdf_Color | $color | ) |
Set line color.
Zend_Pdf_Color | $color |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
setLineWidth | ( | $width | ) |
Set line width.
float | $width |
Implemented in Zend_Pdf_Canvas_Abstract.
setStyle | ( | Zend_Pdf_Style | $style | ) |
Set the style to use for future drawing operations on this page
Zend_Pdf_Style | $style |
Implemented in Zend_Pdf_Canvas_Abstract.
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 |
Implemented in Zend_Pdf_Canvas_Abstract.
translate | ( | $xShift, | |
$yShift | |||
) |
Translate coordination system.
float | $xShift | - X coordinate shift |
float | $yShift | - Y coordinate shift |
Implemented in Zend_Pdf_Canvas_Abstract.