Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
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 () | |
restoreGS () | |
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) | |
![]() | |
getResources () | |
getContents () | |
getHeight () | |
getWidth () | |
Protected Member Functions | |
_addProcSet ($procSetName) | |
_attachResource ($type, Zend_Pdf_Resource $resource) | |
Protected Attributes | |
$_contents = '' | |
$_font = null | |
$_fontSize | |
$_style = null | |
$_saveCount = 0 | |
Definition at line 47 of file Abstract.php.
|
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.
Definition at line 390 of file Abstract.php.
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.
Definition at line 416 of file Abstract.php.
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.
Definition at line 498 of file Abstract.php.
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.
Definition at line 536 of file Abstract.php.
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.
Definition at line 120 of file Abstract.php.
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.
Definition at line 577 of file Abstract.php.
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.
Definition at line 606 of file Abstract.php.
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.
Definition at line 726 of file Abstract.php.
drawLayoutBox | ( | $box, | |
$x, | |||
$y | |||
) |
Draw a LayoutBox at the specified position on the page.
Implements Zend_Pdf_Canvas_Interface.
Definition at line 757 of file Abstract.php.
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.
Definition at line 772 of file Abstract.php.
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.
Definition at line 801 of file Abstract.php.
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.
Definition at line 862 of file Abstract.php.
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.
Definition at line 909 of file Abstract.php.
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.
Definition at line 1039 of file Abstract.php.
getFont | ( | ) |
Get current font.
Implements Zend_Pdf_Canvas_Interface.
Definition at line 289 of file Abstract.php.
getFontSize | ( | ) |
Get current font size
Implements Zend_Pdf_Canvas_Interface.
Definition at line 299 of file Abstract.php.
getStyle | ( | ) |
Return the style, applied to the page.
Implements Zend_Pdf_Canvas_Interface.
Definition at line 309 of file Abstract.php.
pathClose | ( | ) |
Close the path by drawing a straight line back to it's beginning.
Implements Zend_Pdf_Canvas_Interface.
Definition at line 1068 of file Abstract.php.
pathLine | ( | $x, | |
$y | |||
) |
Continue the open path in a straight line to the specified position.
Implements Zend_Pdf_Canvas_Interface.
Definition at line 1083 of file Abstract.php.
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.
Definition at line 1099 of file Abstract.php.
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.
Definition at line 1208 of file Abstract.php.
restoreGS | ( | ) |
Restore the graphics state that was saved with the last call to saveGS().
Zend_Pdf_Exception | - if there is no previously saved state |
Definition at line 339 of file Abstract.php.
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.
Definition at line 1113 of file Abstract.php.
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.
Definition at line 323 of file Abstract.php.
scale | ( | $xScale, | |
$yScale | |||
) |
Scale coordination system.
float | $xScale | - X dimention scale factor |
float | $yScale | - Y dimention scale factor |
Implements Zend_Pdf_Canvas_Interface.
Definition at line 1141 of file Abstract.php.
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.
Definition at line 364 of file Abstract.php.
setFillColor | ( | Zend_Pdf_Color | $color | ) |
Set fill color.
Zend_Pdf_Color | $color |
Implements Zend_Pdf_Canvas_Interface.
Definition at line 170 of file Abstract.php.
setFont | ( | Zend_Pdf_Resource_Font | $font, |
$fontSize | |||
) |
Set current font.
Zend_Pdf_Resource_Font | $font | |
float | $fontSize |
Implements Zend_Pdf_Canvas_Interface.
Definition at line 249 of file Abstract.php.
setLineColor | ( | Zend_Pdf_Color | $color | ) |
Set line color.
Zend_Pdf_Color | $color |
Implements Zend_Pdf_Canvas_Interface.
Definition at line 184 of file Abstract.php.
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.
Definition at line 218 of file Abstract.php.
setLineWidth | ( | $width | ) |
Set line width.
float | $width |
Implements Zend_Pdf_Canvas_Interface.
Definition at line 198 of file Abstract.php.
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.
Definition at line 270 of file Abstract.php.
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.
Definition at line 1179 of file Abstract.php.
translate | ( | $xShift, | |
$yShift | |||
) |
Translate coordination system.
float | $xShift | - X coordinate shift |
float | $yShift | - Y coordinate shift |
Implements Zend_Pdf_Canvas_Interface.
Definition at line 1159 of file Abstract.php.
|
protected |
Definition at line 54 of file Abstract.php.
|
protected |
Definition at line 61 of file Abstract.php.
|
protected |
Definition at line 68 of file Abstract.php.
|
protected |
Definition at line 83 of file Abstract.php.
|
protected |
Definition at line 75 of file Abstract.php.