SetaPDF_Core_Canvas_Draw A canvas helper class for draw operators

File: /SetaPDF v2/Core/Canvas/Draw.php

Class hierarchy

Summary

Constants

STYLE_DRAW

public const int SetaPDF_Core_Canvas_Draw::STYLE_DRAW = 2

Only draw style

STYLE_DRAW_AND_FILL

Draw and fill style

STYLE_FILL

public const int SetaPDF_Core_Canvas_Draw::STYLE_FILL = 1

Only fill style


Properties

$_canvas

The origin canvas object


Methods

__construct()

The constructor.

Parameters
$canvas : SetaPDF_Core_Canvas
 

_drawStyle()

protected SetaPDF_Core_Canvas_Draw::_drawStyle (
int $style
): void

Call the specific path function depending on the used style.

Parameters
$style : int
 

addCurrentTransformationMatrix()

public SetaPDF_Core_Canvas_StandardOperators::addCurrentTransformationMatrix (
float|int $a, float|int $b, float|int $c, float|int $d, float|int $e, float|int $f
): $this

Proxy method for adding a transformation matrix on the canvas.

Parameters
$a : float|int
 
$b : float|int
 
$c : float|int
 
$d : float|int
 
$e : float|int
 
$f : float|int
 
See

circle()

public SetaPDF_Core_Canvas_Draw::circle (
float $x, float $y, float $r [, int $style = SetaPDF_Core_Canvas_Draw::STYLE_DRAW ]
): SetaPDF_Core_Canvas_Draw

Draws a circle on the canvas.

Parameters
$x : float

Abscissa of center.

$y : float

Ordinate of center.

$r : float

Radius.

$style : int
 

cleanUp()

public SetaPDF_Core_Canvas_Operators::cleanUp (
void
): void

Release objects to free memory and cycled references.

After calling this method the instance of this object is unusable!

draw()

Get the draw helper.

ellipse()

public SetaPDF_Core_Canvas_Draw::ellipse (
float $x, float $y, float $rx, float $ry [, int $style = SetaPDF_Core_Canvas_Draw::STYLE_DRAW ]
): SetaPDF_Core_Canvas_Draw

Draws an ellipse on the canvas.

Parameters
$x : float

Abscissa of center.

$y : float

Ordinate of center.

$rx : float

Horizontal radius.

$ry : float

Vertical radius.

$style : int
 

line()

public SetaPDF_Core_Canvas_Draw::line (
float $x1, float $y1, float $x2, float $y2
): SetaPDF_Core_Canvas_Draw

Draws a line on the canvas.

Parameters
$x1 : float
 
$y1 : float
 
$x2 : float
 
$y2 : float
 

path()

Get the path helper.

polygon()

Draws a polygon on the canvas.

Parameters
$points : float[]

Array of the form (x1, y1, x2, y2, ..., xn, yn) where (x1, y1) is the starting point and (xn, yn) is the last one. Must contain at least 3 points.

$style : int
 

rect()

public SetaPDF_Core_Canvas_Draw::rect (
float $x1, float $y1, float $width, float $height [, int $style = SetaPDF_Core_Canvas_Draw::STYLE_DRAW ]
): SetaPDF_Core_Canvas_Draw

Draws a rectangle on the canvas.

Parameters
$x1 : float
 
$y1 : float
 
$width : float
 
$height : float
 
$style : int
 

restoreGraphicState()

Proxy method for restoring the graphic state on the canvas.

See

rotate()

public SetaPDF_Core_Canvas_StandardOperators::rotate (
int|float $x, int|float $y, int|float $angle
): $this

Proxy method for rotating the transformation matrix on the canvas.

Parameters
$x : int|float

X-coordinate of rotation point

$y : int|float

Y-coordinate of rotation point

$angle : int|float

Angle to rotate in degrees

See

saveGraphicState()

Proxy method for saving the graphic state on the canvas.

See

scale()

public SetaPDF_Core_Canvas_StandardOperators::scale (
int|float $scaleX, int|float $scaleY
): $this

Proxy method for scaling the transformation matrix on the canvas.

Parameters
$scaleX : int|float

Scale factor on X

$scaleY : int|float

Scale factor on Y

See

setColor()

public SetaPDF_Core_Canvas_StandardOperators::setColor (
SetaPDF_Core_DataStructure_Color|int[]|int|string $color [, boolean $stroking = true ]
): $this

Proxy method for setting the color on the canvas.

Parameters
$color : SetaPDF_Core_DataStructure_Color|int[]|int|string
 
$stroking : boolean
 
See

setGraphicState()

Proxy method for setting a graphic state on the canvas.

Parameters
$graphicState : SetaPDF_Core_Resource_ExtGState
 
See

setNonStrokingColor()

Proxy method for setting the non-stroking color on the canvas.

Parameters
$color : SetaPDF_Core_DataStructure_Color|int[]|int|string
 
See

setStrokingColor()

Proxy method for setting the stroking color on the canvas.

Parameters
$color : SetaPDF_Core_DataStructure_Color|int[]|int|string
 
See

skew()

public SetaPDF_Core_Canvas_StandardOperators::skew (
int|float $angleX, int|float $angleY [, int|float $x = 0 [, int|float $y = 0 ]]
): $this

Proxy method for skewing the transformation matrix on the canvas.

Parameters
$angleX : int|float

Angle to x-axis in degrees

$angleY : int|float

Angle to y-axis in degrees

$x : int|float

Points to stretch on x-axis

$y : int|float

Point to stretch on y-axis

See

text()

Get the text helper.

translate()

public SetaPDF_Core_Canvas_StandardOperators::translate (
int|float $shiftX, int|float $shiftY
): $this

Proxy method for moving the transformation matrix on the canvas.

Parameters
$shiftX : int|float

Points to move on x-axis

$shiftY : int|float

Points to move on y-axis

See