Path
in package
Pdf page path class
Tags
Table of Contents
Constants
- CLIPPING = 'W'
- CLIPPING_EVEN_ODD = 'W*'
- CLIPPING_EVEN_ODD_FILL = 'W* F'
- CLIPPING_EVEN_ODD_NO_STYLE = 'W* n'
- CLIPPING_FILL = 'W F'
- CLIPPING_NO_STYLE = 'W n'
- FILL = 'F'
- FILL_EVEN_ODD = 'f*'
- FILL_STROKE = 'B'
- FILL_STROKE_CLOSE = 'b'
- FILL_STROKE_CLOSE_EVEN_ODD = 'b*'
- FILL_STROKE_EVEN_ODD = 'B*'
- NO_STYLE = 'n'
- STROKE = 'S'
- Style constants
- STROKE_CLOSE = 's'
Properties
- $allowedStyles : array<string|int, mixed>
- Allowed styles
- $streams : array<string|int, mixed>|null
- Path streams array
- $style : string
- Path style
Methods
- __construct() : mixed
- Constructor
- closeLayer() : Path
- Close a graphics state layer
- drawArc() : Path
- Draw an arc
- drawChord() : Path
- Draw a chord
- drawCircle() : Path
- Draw a circle
- drawClosedCubicBezierCurve() : Path
- Draw a closed cubic bezier curve
- drawClosedQuadraticBezierCurve() : Path
- Draw an open quadratic bezier curve, single control point
- drawEllipse() : Path
- Draw an ellipse
- drawLine() : Path
- Draw a line
- drawOpenCubicBezierCurve() : Path
- Draw an open cubic bezier curve
- drawOpenQuadraticBezierCurve() : Path
- Draw an open quadratic bezier curve, single control point
- drawPie() : Path
- Draw a pie slice
- drawPolygon() : Path
- Draw a polygon
- drawRectangle() : Path
- Draw a rectangle
- drawRoundedRectangle() : Path
- Draw a rounded rectangle
- drawRoundedSquare() : Path
- Draw a rounded square
- drawSquare() : Path
- Draw a square
- getStreams() : array<string|int, mixed>|null
- Get the streams
- getStyle() : string
- Get the current style
- openLayer() : Path
- Open a graphics state layer
- setFillColor() : Path
- Set the path fill color
- setStroke() : Path
- Set the stroke properties
- setStrokeColor() : Path
- Set the path stroke color
- setStyle() : Path
- Set the style
- calculateArc() : void
- Calculate arc
- calculateDegrees() : array<string|int, mixed>
- Calculate degrees
Constants
CLIPPING
public
mixed
CLIPPING
= 'W'
CLIPPING_EVEN_ODD
public
mixed
CLIPPING_EVEN_ODD
= 'W*'
CLIPPING_EVEN_ODD_FILL
public
mixed
CLIPPING_EVEN_ODD_FILL
= 'W* F'
CLIPPING_EVEN_ODD_NO_STYLE
public
mixed
CLIPPING_EVEN_ODD_NO_STYLE
= 'W* n'
CLIPPING_FILL
public
mixed
CLIPPING_FILL
= 'W F'
CLIPPING_NO_STYLE
public
mixed
CLIPPING_NO_STYLE
= 'W n'
FILL
public
mixed
FILL
= 'F'
FILL_EVEN_ODD
public
mixed
FILL_EVEN_ODD
= 'f*'
FILL_STROKE
public
mixed
FILL_STROKE
= 'B'
FILL_STROKE_CLOSE
public
mixed
FILL_STROKE_CLOSE
= 'b'
FILL_STROKE_CLOSE_EVEN_ODD
public
mixed
FILL_STROKE_CLOSE_EVEN_ODD
= 'b*'
FILL_STROKE_EVEN_ODD
public
mixed
FILL_STROKE_EVEN_ODD
= 'B*'
NO_STYLE
public
mixed
NO_STYLE
= 'n'
STROKE
Style constants
public
mixed
STROKE
= 'S'
STROKE_CLOSE
public
mixed
STROKE_CLOSE
= 's'
Properties
$allowedStyles
Allowed styles
protected
array<string|int, mixed>
$allowedStyles
= ['S', 's', 'F', 'f*', 'B', 'B*', 'b', 'b*', 'W', 'W F', 'W*', 'W* F', 'W* n', 'n']
$streams
Path streams array
protected
array<string|int, mixed>|null
$streams
= null
$style
Path style
protected
string
$style
= 'S'
Methods
__construct()
Constructor
public
__construct([string $style = Path::STROKE ]) : mixed
Instantiate a PDF path object
Parameters
- $style : string = Path::STROKE
closeLayer()
Close a graphics state layer
public
closeLayer() : Path
Return values
PathdrawArc()
Draw an arc
public
drawArc(int $x, int $y, int $start, int $end, int $w[, int|null $h = null ]) : Path
Parameters
- $x : int
- $y : int
- $start : int
- $end : int
- $w : int
- $h : int|null = null
Return values
PathdrawChord()
Draw a chord
public
drawChord(int $x, int $y, int $start, int $end, int $w[, int|null $h = null ]) : Path
Parameters
- $x : int
- $y : int
- $start : int
- $end : int
- $w : int
- $h : int|null = null
Return values
PathdrawCircle()
Draw a circle
public
drawCircle(int $x, int $y, int $w) : Path
Parameters
- $x : int
- $y : int
- $w : int
Return values
PathdrawClosedCubicBezierCurve()
Draw a closed cubic bezier curve
public
drawClosedCubicBezierCurve(int $x1, int $y1, int $x2, int $y2, int $bezierX1, int $bezierY1, int $bezierX2, int $bezierY2) : Path
Parameters
- $x1 : int
- $y1 : int
- $x2 : int
- $y2 : int
- $bezierX1 : int
- $bezierY1 : int
- $bezierX2 : int
- $bezierY2 : int
Return values
PathdrawClosedQuadraticBezierCurve()
Draw an open quadratic bezier curve, single control point
public
drawClosedQuadraticBezierCurve(int $x1, int $y1, int $x2, int $y2, int $bezierX, int $bezierY[, bool $first = true ]) : Path
Parameters
- $x1 : int
- $y1 : int
- $x2 : int
- $y2 : int
- $bezierX : int
- $bezierY : int
- $first : bool = true
Return values
PathdrawEllipse()
Draw an ellipse
public
drawEllipse(int $x, int $y, int $w[, int|null $h = null ]) : Path
Parameters
- $x : int
- $y : int
- $w : int
- $h : int|null = null
Return values
PathdrawLine()
Draw a line
public
drawLine(int $x1, int $y1, int $x2, int $y2) : Path
Parameters
- $x1 : int
- $y1 : int
- $x2 : int
- $y2 : int
Return values
PathdrawOpenCubicBezierCurve()
Draw an open cubic bezier curve
public
drawOpenCubicBezierCurve(int $x1, int $y1, int $x2, int $y2, int $bezierX1, int $bezierY1, int $bezierX2, int $bezierY2) : Path
Parameters
- $x1 : int
- $y1 : int
- $x2 : int
- $y2 : int
- $bezierX1 : int
- $bezierY1 : int
- $bezierX2 : int
- $bezierY2 : int
Return values
PathdrawOpenQuadraticBezierCurve()
Draw an open quadratic bezier curve, single control point
public
drawOpenQuadraticBezierCurve(int $x1, int $y1, int $x2, int $y2, int $bezierX, int $bezierY[, bool $first = true ]) : Path
Parameters
- $x1 : int
- $y1 : int
- $x2 : int
- $y2 : int
- $bezierX : int
- $bezierY : int
- $first : bool = true
Return values
PathdrawPie()
Draw a pie slice
public
drawPie(int $x, int $y, int $start, int $end, int $w[, int|null $h = null ]) : Path
Parameters
- $x : int
- $y : int
- $start : int
- $end : int
- $w : int
- $h : int|null = null
Return values
PathdrawPolygon()
Draw a polygon
public
drawPolygon(array<string|int, mixed> $points) : Path
Parameters
- $points : array<string|int, mixed>
Tags
Return values
PathdrawRectangle()
Draw a rectangle
public
drawRectangle(int $x, int $y, int $w[, int|null $h = null ]) : Path
Parameters
- $x : int
- $y : int
- $w : int
- $h : int|null = null
Return values
PathdrawRoundedRectangle()
Draw a rounded rectangle
public
drawRoundedRectangle(int $x, int $y, int $w[, int|null $h = null ][, int $rx = 10 ][, int|null $ry = null ]) : Path
Parameters
- $x : int
- $y : int
- $w : int
- $h : int|null = null
- $rx : int = 10
- $ry : int|null = null
Return values
PathdrawRoundedSquare()
Draw a rounded square
public
drawRoundedSquare(int $x, int $y, int $w[, int $rx = 10 ][, int|null $ry = null ]) : Path
Parameters
- $x : int
- $y : int
- $w : int
- $rx : int = 10
- $ry : int|null = null
Return values
PathdrawSquare()
Draw a square
public
drawSquare(int $x, int $y, int $w) : Path
Parameters
- $x : int
- $y : int
- $w : int
Return values
PathgetStreams()
Get the streams
public
getStreams() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetStyle()
Get the current style
public
getStyle() : string
Return values
stringopenLayer()
Open a graphics state layer
public
openLayer() : Path
Return values
PathsetFillColor()
Set the path fill color
public
setFillColor(ColorInterface $color) : Path
Parameters
- $color : ColorInterface
Return values
PathsetStroke()
Set the stroke properties
public
setStroke(int $width[, int|null $dashLength = null ][, int|null $dashGap = null ]) : Path
Parameters
- $width : int
- $dashLength : int|null = null
- $dashGap : int|null = null
Return values
PathsetStrokeColor()
Set the path stroke color
public
setStrokeColor(ColorInterface $color) : Path
Parameters
- $color : ColorInterface
Return values
PathsetStyle()
Set the style
public
setStyle(string $style) : Path
Parameters
- $style : string
Return values
PathcalculateArc()
Calculate arc
protected
calculateArc(int $x, int $y, array<string|int, mixed> $degrees, int $w[, int|null $h = null ][, bool $closed = false ][, bool $pie = false ]) : void
Parameters
- $x : int
- $y : int
- $degrees : array<string|int, mixed>
- $w : int
- $h : int|null = null
- $closed : bool = false
- $pie : bool = false
calculateDegrees()
Calculate degrees
protected
calculateDegrees(int $start, int $end) : array<string|int, mixed>
Parameters
- $start : int
- $end : int