SetaPDF_Core_Canvas_GraphicState A canvas helper class for graphicState operators
File: /SetaPDF v2/Core/Canvas/GraphicState.php
Class hierarchy
Summary
Static Properties
$_maxGraphicStateNestingLevel
The maximum nesting level of the graphic states (default in PDF 1.7 was 28; we increased it due to several user complaints and the fact that this limit was removed in PDF 2.0 completely).
See
- PDF 32000-1:2008 - C.2 Architectural limits
Properties
Static Methods
setMaxGraphicStateNestingLevel()
Set the maximum nesting level of graphic states.
Parameters
- $maxGraphicStateNestingLevel : int
Methods
__construct()
The constructor.
Parameters
- $matrix : SetaPDF_Core_Geometry_Matrix
addCurrentTransformationMatrix()
Add a transformation matrix to the stack of the current graphic state.
Parameters
- $a : int|float
- $b : int|float
- $c : int|float
- $d : int|float
- $e : int|float
- $f : int|float
See
- PDF-Reference PDF 32000-1:2008 8.3.4 Transformation Matrices
getCurrentTransformationMatrix()
Get the current transformation matrix.
getUserSpaceXY()
Returns the user space coordinates.
Parameters
- $x : int|float
- $y : int|float
Return Values
array with ('x' => $x, 'y' => $y)
restore()
Restore the last graphic state and pop all matrices of the current graphic state out of the matrix stack.
Exceptions
Throws BadMethodCallException
rotate()
Rotate the graphic state by $angle degrees at the origin defined by $x and $y.
Parameters
- $x : int|float
X-coordinate of rotation point
- $y : int|float
Y-coordinate of rotation point
- $angle : float
Angle to rotate in degrees
save()
Open a new graphic state and copy the entire graphic state onto the stack of the new graphic state.
Exceptions
Throws BadMethodCallException
scale()
Scale the graphic state by the factor $scaleX and $scaleY.
Parameters
- $scaleX : int|float
Scale factor on X
- $scaleY : int|float
Scale factor on Y
skew()
Skew the graphic state.
Parameters
- $angleX : float
Angle to x-axis in degrees
- $angleY : float
Angle to y-axis in degrees
- $x : int
Points to stretch on x-axis
- $y : int
Point to stretch on y-axis
toUserSpace()
Returns the user space coordinates vector.
Parameters
- $vector : SetaPDF_Core_Geometry_Vector
translate()
Move the graphic state by $shiftX and $shiftY on x-axis and y-axis.
Parameters
- $shiftX : int|float
Points to move on x-axis
- $shiftY : int|float
Points to move on y-axis