Documentation

Path
in package

Pdf page path class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.2.0

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
Path

drawArc()

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
Path

drawChord()

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
Path

drawCircle()

Draw a circle

public drawCircle(int $x, int $y, int $w) : Path
Parameters
$x : int
$y : int
$w : int
Return values
Path

drawClosedCubicBezierCurve()

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
Path

drawClosedQuadraticBezierCurve()

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
Path

drawEllipse()

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
Path

drawLine()

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
Path

drawOpenCubicBezierCurve()

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
Path

drawOpenQuadraticBezierCurve()

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
Path

drawPie()

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
Path

drawPolygon()

Draw a polygon

public drawPolygon(array<string|int, mixed> $points) : Path
Parameters
$points : array<string|int, mixed>
Tags
throws
Exception
Return values
Path

drawRectangle()

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
Path

drawRoundedRectangle()

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
Path

drawRoundedSquare()

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
Path

drawSquare()

Draw a square

public drawSquare(int $x, int $y, int $w) : Path
Parameters
$x : int
$y : int
$w : int
Return values
Path

getStreams()

Get the streams

public getStreams() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getStyle()

Get the current style

public getStyle() : string
Return values
string

openLayer()

Open a graphics state layer

public openLayer() : Path
Return values
Path

setStroke()

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
Path

setStyle()

Set the style

public setStyle(string $style) : Path
Parameters
$style : string
Return values
Path

calculateArc()

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
Tags
throws
OutOfRangeException
Return values
array<string|int, mixed>

        
On this page

Search results