Gradient extends Raw
Com\Tecnick\Pdf\Graph\Gradient
Tags
Table of Contents
- MPI = 3.141592653589793
- Pi constant We use this instead of M_PI because HHVM has a different value.
- $col : Pdf
- Color object
- $ctm : array<string|int, mixed>
- Array (stack) of Current Transformation Matrix (CTM), which maps user space coordinates used within a PDF content stream into output device coordinates.
- $ctmid : int
- Current ID for transformation matrix.
- $enc : Encrypt
- Encrypt object
- $extgstates : array<string|int, mixed>
- Array of transparency objects and parameters.
- $gradients : array<string|int, mixed>
- Array of gradients
- $kunit : float
- Unit of measure conversion ratio
- $linecapmap : array<string|int, mixed>
- Map values for lineCap
- $linejoinmap : array<string|int, mixed>
- Map values for lineJoin
- $pageh : float
- Current page height
- $pagew : float
- Current page width
- $pdfa : bool
- True if we are in PDF/A mode.
- $pon : int
- Current PDF object number
- $ppopmap : array<string|int, mixed>
- Map path paint operators
- $style : array<string|int, mixed>
- Stack containing style data
- $styleid : int
- Stack index
- $stylemark : array<string|int, mixed>
- Array of restore points (style ID)
- __construct() : mixed
- Initialize
- add() : string
- Add a new style
- degToRad() : float
- Converts the number in degrees to the radian equivalent.
- getAlpha() : string
- Set alpha for stroking (CA) and non-stroking (ca) operations.
- getClippingRect() : string
- Rectangular clipping area.
- getColorRegistrationBar() : string
- Paints registration bars with color transtions
- getCoonsPatchMesh() : string
- Paints a coons patch mesh.
- getCropMark() : string
- Get a crop-mark.
- getCtmProduct() : array<string|int, mixed>
- Get the product of two Tranformation Matrix.
- getCurrentStyleArray() : array<string|int, mixed>
- Returns the last style array
- getCurrentStyleItem() : mixed
- Returns the value of th especified item from the last inserted style
- getExtGState() : string
- Add transparency parameters to the current extgstate
- getGradient() : string
- Get a color gradient command.
- getGradientsArray() : array<string|int, mixed>
- Returns the gradients array
- getGradientTransform() : string
- Rectangular clipping area.
- getHorizMirroring() : string
- Horizontal Mirroring.
- getHorizScaling() : string
- Horizontal Scaling.
- getHorizSkewing() : string
- Skew horizontally.
- getHorizTranslation() : string
- Translate graphic object horizontally.
- getLastStyleProperty() : mixed
- Returns the last set value of the specified property
- getLinearGradient() : string
- Get a linear colour gradient command.
- getModeWithoutClose() : string
- Remove the Close option from the specified Path paint operator.
- getModeWithoutFill() : string
- Remove the Fill option from the specified Path paint operator.
- getModeWithoutStroke() : string
- Remove the Stroke option from the specified Path paint operator.
- getObjectNumber() : int
- Returns current PDF object number
- getOutExtGState() : string
- Get the PDF output string for ExtGState
- getOutExtGStateResources() : string
- Get the PDF output string for ExtGState Resource Dictionary
- getOutGradientResources() : string
- Get the PDF output string for Gradients Resource Dictionary
- getOutGradientShaders() : string
- Get the PDF output string for gradient shaders
- getOverprint() : string
- Get overprint mode for stroking (OP) and non-stroking (op) painting operations.
- getPathPaintOp() : string
- Get the Path-Painting Operators.
- getPointMirroring() : string
- Point reflection mirroring.
- getPropScaling() : string
- Vertical and horizontal proportional Scaling.
- getRadialGradient() : string
- Get a radial colour gradient command.
- getRawCurve() : string
- Append a cubic Bezier curve to the current path.
- getRawCurveV() : string
- Append a cubic Bezier curve to the current path.
- getRawCurveY() : string
- Append a cubic Bezier curve to the current path.
- getRawEllipticalArc() : string
- Append an elliptical arc to the current path.
- getRawLine() : string
- Append a straight line segment from the current point to the specified one.
- getRawPoint() : string
- Begin a new subpath by moving the current point to the specified coordinates, omitting any connecting line segment.
- getRawRect() : string
- Append a rectangle to the current path as a complete subpath, with lower-left corner in the specified point and dimensions width and height in user units.
- getReflection() : string
- Reflection against a straight line through point (x, y) with the gradient angle (angle).
- getRotation() : string
- Rotation.
- getScaling() : string
- Vertical and horizontal non-proportional Scaling.
- getSkewing() : string
- Skew.
- getStartTransform() : string
- Starts a 2D transformation saving current graphic state.
- getStopTransform() : string
- Stops a 2D tranformation restoring previous graphic state.
- getStyle() : string
- Returns the PDF string of the last style added.
- getStyleCmd() : string
- Returns the PDF string of the specified style.
- getTransformation() : string
- Get the tranformation matrix (CTM) PDF string
- getTransformIndex() : int
- Returns the transformation stack index.
- getTransformStack() : array<string|int, mixed>
- Returns the transformation stack.
- getTranslation() : string
- Translate graphic object horizontally and vertically.
- getVectorsAngle() : float
- Returns the angle in radiants between two vectors with the same origin point.
- getVertMirroring() : string
- Verical Mirroring.
- getVertScaling() : string
- Vertical Scaling.
- getVertSkewing() : string
- Skew vertically.
- getVertTranslation() : string
- Translate graphic object vertically.
- init() : mixed
- Initialize objects
- isClosingMode() : bool
- Returns true if the specified mode includes "closing the path" option
- isFillingMode() : bool
- Returns true if the specified path paint operator includes the filling option
- isStrokingMode() : bool
- Returns true if the specified mode includes the stroking option
- pop() : string
- Remove and return last style
- restoreStyleStaus() : mixed
- Restore the saved style status
- saveStyleStaus() : mixed
- Save the current style ID to be restored later
- setKUnit() : mixed
- Set unit of measure conversion ratio.
- setPageHeight() : mixed
- Set page height
- setPageWidth() : mixed
- Set page width
- getGradientStops() : array<string|int, mixed>
- Process the gradient stops.
- getLineModeCmd() : string
- Returns the PDF string of the specified line style
- getOutGradientCols() : string
- Get the PDF output string for gradient colors and transparency
- getOutPatternObj() : string
- Get the PDF output string for the pattern and shading object
- setRawEllipticalArcAngles() : mixed
- Initialize angles for the elliptical arc.
Constants
MPI
Pi constant We use this instead of M_PI because HHVM has a different value.
public float MPI = 3.141592653589793
Properties
$col
Color object
protected Pdf $col
$ctm
Array (stack) of Current Transformation Matrix (CTM), which maps user space coordinates used within a PDF content stream into output device coordinates.
protected array<string|int,
mixed> $ctm = array()
$ctmid
Current ID for transformation matrix.
protected int $ctmid = -1
$enc
Encrypt object
protected Encrypt
$enc
$extgstates
Array of transparency objects and parameters.
protected array<string|int,
mixed> $extgstates = array()
$gradients
Array of gradients
protected array<string|int,
mixed> $gradients = array()
$kunit
Unit of measure conversion ratio
protected float $kunit = 1.0
$linecapmap
Map values for lineCap
protected static array<string|int,
mixed> $linecapmap = array(0 => 0, 1 =>
1, 2 => 2, 'butt' => 0, 'round' => 1, 'square' =>
2)
$linejoinmap
Map values for lineJoin
protected static array<string|int,
mixed> $linejoinmap = array(0 => 0, 1 =>
1, 2 => 2, 'miter' => 0, 'round' => 1, 'bevel' =>
2)
$pageh
Current page height
protected float $pageh = 0
$pagew
Current page width
protected float $pagew = 0
$pdfa
True if we are in PDF/A mode.
protected bool $pdfa = false
$pon
Current PDF object number
protected int $pon
$ppopmap
Map path paint operators
protected static array<string|int,
mixed> $ppopmap = array('S' => 'S', 'D'
=> 'S', 's' => 's', 'h S' => 's', 'd' => 's', 'f' =>
'f', 'F' => 'f', 'h f' => 'h f', 'f*' => 'f*', 'F*' =>
'f*', 'h f*' => 'h f*', 'B' => 'B', 'FD' => 'B', 'DF'
=> 'B', 'B*' => 'B*', 'F*D' => 'B*', 'DF*' => 'B*', 'b'
=> 'b', 'h B' => 'b', 'fd' => 'b', 'df' => 'b', 'b*'
=> 'b*', 'h B*' => 'b*', 'f*d' => 'b*', 'df*' => 'b*',
'W n' => 'W n', 'CNZ' => 'W n', 'W* n' => 'W* n', 'CEO'
=> 'W* n', 'h' => 'h', 'n' => 'n')
$style
Stack containing style data
protected array<string|int,
mixed> $style = array()
$styleid
Stack index
protected int $styleid = -1
$stylemark
Array of restore points (style ID)
protected array<string|int,
mixed> $stylemark = array(0)
Methods
__construct()
Initialize
public __construct(float $kunit,
float $pagew,
float $pageh,
Pdf $color,
Encrypt $enc[,
bool $pdfa
= false
]) : mixed
Parameters
- $kunit : float
-
Unit of measure conversion ratio.
- $pagew : float
-
Page width.
- $pageh : float
-
Page height.
- $color : Pdf
-
Color object.
- $enc : Encrypt
- $pdfa : bool = false
-
True if we are in PDF/A mode.
Return values
mixed —add()
Add a new style
public add([array<string|int,
mixed> $style
= array()
][,
bool $inheritlast
= false
]) : string
Parameters
- $style : array<string|int, mixed> = array()
-
Style to add.
- $inheritlast : bool = false
-
If true inherit missing values from the last style.
Return values
string —PDF style string
degToRad()
Converts the number in degrees to the radian equivalent.
public degToRad(float $deg)
: float
We use this instead of $this->degToRad to avoid precision problems with hhvm.
Parameters
- $deg : float
-
Angular value in degrees.
Return values
float —Angle in radiants
getAlpha()
Set alpha for stroking (CA) and non-stroking (ca) operations.
public getAlpha([float $stroking
= 1
][,
string $bmv
= 'Normal'
][,
float $nonstroking
= ''
][,
bool $ais
= false
]) : string
Parameters
- $stroking : float = 1
-
Alpha value for stroking operations: real value from 0 (transparent) to 1 (opaque).
- $bmv : string = 'Normal'
-
Blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity.
- $nonstroking : float = ''
-
Alpha value for non-stroking operations: real value from 0 (transparent) to 1 (opaque).
- $ais : bool = false
Return values
string —PDF command
getClippingRect()
Rectangular clipping area.
public getClippingRect(float $posx,
float $posy,
float $width,
float $height)
: string
Parameters
- $posx : float
-
Abscissa of the top left corner of the rectangle.
- $posy : float
-
Ordinate of the top left corner of the rectangle.
- $width : float
-
Width of the rectangle.
- $height : float
-
Height of the rectangle.
Return values
string —getColorRegistrationBar()
Paints registration bars with color transtions
public getColorRegistrationBar(float $posx,
float $posy,
float $width,
float $height[,
bool $vertical
= false
][,
array<string|int,
mixed> $colors
= array(
array('g(0%)', 'g(100%)'), // GRAY : black to white
array('rgb(100%,0%,0%)', 'rgb(100%,100%,100%)'), // RGB : red to
white array('rgb(0%,100%,0%)', 'rgb(100%,100%,100%)'), // RGB :
green to white array('rgb(0%,0%,100%)', 'rgb(100%,100%,100%)'), //
RGB : blue to white array('cmyk(100%,0%,0,0%)',
'cmyk(0%,0%,0,0%)'), // CMYK : cyan to white
array('cmyk(0%,100%,0,0%)', 'cmyk(0%,0%,0,0%)'), // CMYK : magenta
to white array('cmyk(0%,0%,100,0%)', 'cmyk(0%,0%,0,0%)'), // CMYK :
yellow to white array('cmyk(0%,0%,0,100%)', 'cmyk(0%,0%,0,0%)'),
) ]) :
string
Parameters
- $posx : float
-
Abscissa of the top left corner of the rectangle.
- $posy : float
-
Ordinate of the top left corner of the rectangle.
- $width : float
-
Width of the rectangle.
- $height : float
-
Height of the rectangle.
- $vertical : bool = false
-
If true prints bar vertically, otherwise horizontally.
- $colors : array<string|int, mixed> = array( array('g(0%)', 'g(100%)'), // GRAY : black to white array('rgb(100%,0%,0%)', 'rgb(100%,100%,100%)'), // RGB : red to white array('rgb(0%,100%,0%)', 'rgb(100%,100%,100%)'), // RGB : green to white array('rgb(0%,0%,100%)', 'rgb(100%,100%,100%)'), // RGB : blue to white array('cmyk(100%,0%,0,0%)', 'cmyk(0%,0%,0,0%)'), // CMYK : cyan to white array('cmyk(0%,100%,0,0%)', 'cmyk(0%,0%,0,0%)'), // CMYK : magenta to white array('cmyk(0%,0%,100,0%)', 'cmyk(0%,0%,0,0%)'), // CMYK : yellow to white array('cmyk(0%,0%,0,100%)', 'cmyk(0%,0%,0,0%)'), )
-
Array of colors to print, each entry is a color string or an array of two transition colors;
Return values
string —PDF command
getCoonsPatchMesh()
Paints a coons patch mesh.
public getCoonsPatchMesh(float $posx,
float $posy,
float $width,
float $height[,
string $colll
= 'yellow'
][,
string $collr
= 'blue'
][,
string $colur
= 'green'
][,
string $colul
= 'red'
][,
array<string|int,
mixed> $coords
= array(0.0, 0.0,
0.33, 0.0, 0.67, 0.0, 1.0, 0.0, 1.0, 0.33, 1.0, 0.67, 1.0, 1.0,
0.67, 1.0, 0.33, 1.0, 0.0, 1.0, 0.0, 0.67, 0.0, 0.33)
], array<string|int,
mixed> $coords_min[,
array<string|int,
mixed> $coords_max
= 1
][,
bool $antialias
= false
]) : string
Parameters
- $posx : float
-
Abscissa of the top left corner of the rectangle.
- $posy : float
-
Ordinate of the top left corner of the rectangle.
- $width : float
-
Width of the rectangle.
- $height : float
-
Height of the rectangle.
- $colll : string = 'yellow'
-
Lower-Left corner color.
- $collr : string = 'blue'
-
Lower-Right corner color.
- $colur : string = 'green'
-
Upper-Right corner color.
- $colul : string = 'red'
-
Upper-Left corner color.
- $coords : array<string|int, mixed> = array(0.0, 0.0, 0.33, 0.0, 0.67, 0.0, 1.0, 0.0, 1.0, 0.33, 1.0, 0.67, 1.0, 1.0, 0.67, 1.0, 0.33, 1.0, 0.0, 1.0, 0.0, 0.67, 0.0, 0.33)
-
For one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1). For two or more patch meshes: array[number of patches] - arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch colors: must be 4 colors for the first patch, 2 colors for the following patches
- $coords_min : array<string|int, mixed>
-
Minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min.
- $coords_max : array<string|int, mixed> = 1
-
Maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max.
- $antialias : bool = false
-
Flag indicating whether to filter the shading function to prevent aliasing artifacts.
Tags
Return values
string —PDF command
getCropMark()
Get a crop-mark.
public getCropMark(float $posx,
float $posy,
float $width,
float $height[,
string $type
= 'TBLR'
][,
array<string|int,
mixed> $style
= array()
]) : string
Parameters
- $posx : float
-
Abscissa of the crop-mark center.
- $posy : float
-
Ordinate of the crop-mark center.
- $width : float
-
Width of the crop-mark.
- $height : float
-
Height of the crop-mark.
- $type : string = 'TBLR'
-
Type of crop mark - one symbol per type: T = TOP, B = BOTTOM, L = LEFT, R = RIGHT
- $style : array<string|int, mixed> = array()
-
Line style to apply.
Return values
string —PDF command
getCtmProduct()
Get the product of two Tranformation Matrix.
public getCtmProduct(array<string|int,
mixed> $tma,
array<string|int,
mixed> $tmb)
: array<string|int,
mixed>
Parameters
- $tma : array<string|int, mixed>
-
First Tranformation Matrix.
- $tmb : array<string|int, mixed>
-
Second Tranformation Matrix.
Return values
array<string|int, mixed> —CTM Transformation Matrix.
getCurrentStyleArray()
Returns the last style array
public getCurrentStyleArray()
: array<string|int,
mixed>
Return values
array<string|int, mixed> —getCurrentStyleItem()
Returns the value of th especified item from the last inserted style
public getCurrentStyleItem(mixed $item)
: mixed
Parameters
- $item : mixed
Return values
mixed —getExtGState()
Add transparency parameters to the current extgstate
public getExtGState(array<string|int,
mixed> $parms)
: string
Parameters
- $parms : array<string|int, mixed>
-
parameters
Return values
string —PDF command
getGradient()
Get a color gradient command.
public getGradient(int $type,
array<string|int,
mixed> $coords,
array<string|int,
mixed> $stops,
string $bgcolor[,
bool $antialias
= false
]) : string
Parameters
- $type : int
-
Type of gradient (Not all types are currently supported): 1 = Function-based shading; 2 = Axial shading; 3 = Radial shading; 4 = Free-form Gouraud-shaded triangle mesh; 5 = Lattice-form Gouraud-shaded triangle mesh; 6 = Coons patch mesh; 7 Tensor-product patch mesh
- $coords : array<string|int, mixed>
-
Array of coordinates.
- $stops : array<string|int, mixed>
-
Array gradient color components: color = color; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1).
- $bgcolor : string
-
Background color
- $antialias : bool = false
-
Flag indicating whether to filter the shading function to prevent aliasing artifacts.
Return values
string —PDF command
getGradientsArray()
Returns the gradients array
public getGradientsArray()
: array<string|int,
mixed>
Return values
array<string|int, mixed> —getGradientTransform()
Rectangular clipping area.
public getGradientTransform(float $posx,
float $posy,
float $width,
float $height)
: string
Parameters
- $posx : float
-
Abscissa of the top left corner of the rectangle.
- $posy : float
-
Ordinate of the top left corner of the rectangle.
- $width : float
-
Width of the rectangle.
- $height : float
-
Height of the rectangle.
Return values
string —getHorizMirroring()
Horizontal Mirroring.
public getHorizMirroring(float $posx)
: string
Parameters
- $posx : float
-
Abscissa of the mirroring line.
Return values
string —Transformation string
getHorizScaling()
Horizontal Scaling.
public getHorizScaling(float $skx,
float $posx,
float $posy)
: string
Parameters
- $skx : float
-
Horizontal scaling factor.
- $posx : float
-
Abscissa of the scaling center.
- $posy : float
-
Ordinate of the scaling center.
Return values
string —Transformation string
getHorizSkewing()
Skew horizontally.
public getHorizSkewing(float $angx,
float $posx,
float $posy)
: string
Parameters
- $angx : float
-
Angle in degrees between -90 (skew to the left) and 90 (skew to the right)
- $posx : float
-
Abscissa of the skewing center.
- $posy : float
-
Ordinate of the skewing center.
Return values
string —Transformation string
getHorizTranslation()
Translate graphic object horizontally.
public getHorizTranslation(float $trx)
: string
Parameters
- $trx : float
-
Movement to the right.
Return values
string —Transformation string
getLastStyleProperty()
Returns the last set value of the specified property
public getLastStyleProperty(string $property[,
mixed $default
= null
]) : mixed
Parameters
- $property : string
-
Property to search.
- $default : mixed = null
Return values
mixed —Property value or $default in case the property is not found
getLinearGradient()
Get a linear colour gradient command.
public getLinearGradient(float $posx,
float $posy,
float $width,
float $height,
string $colorstart,
string $colorend[,
array<string|int,
mixed> $coords
= array(0, 0, 1,
0) ]) :
string
Parameters
- $posx : float
-
Abscissa of the top left corner of the rectangle.
- $posy : float
-
Ordinate of the top left corner of the rectangle.
- $width : float
-
Width of the rectangle.
- $height : float
-
Height of the rectangle.
- $colorstart : string
-
Starting color.
- $colorend : string
-
Ending color.
- $coords : array<string|int, mixed> = array(0, 0, 1, 0)
-
Gradient vector (x1, y1, x2, y2).
Return values
string —PDF command
getModeWithoutClose()
Remove the Close option from the specified Path paint operator.
public getModeWithoutClose(string $mode)
: string
Parameters
- $mode : string
-
Path paint operator (mode of rendering).
Return values
string —getModeWithoutFill()
Remove the Fill option from the specified Path paint operator.
public getModeWithoutFill(string $mode)
: string
Parameters
- $mode : string
-
Path paint operator (mode of rendering).
Return values
string —getModeWithoutStroke()
Remove the Stroke option from the specified Path paint operator.
public getModeWithoutStroke(string $mode)
: string
Parameters
- $mode : string
-
Path paint operator (mode of rendering).
Return values
string —getObjectNumber()
Returns current PDF object number
public getObjectNumber()
: int
Return values
int —getOutExtGState()
Get the PDF output string for ExtGState
public getOutExtGState(int $pon)
: string
Parameters
- $pon : int
-
Current PDF Object Number
Return values
string —PDF command
getOutExtGStateResources()
Get the PDF output string for ExtGState Resource Dictionary
public getOutExtGStateResources()
: string
Return values
string —PDF command
getOutGradientResources()
Get the PDF output string for Gradients Resource Dictionary
public getOutGradientResources()
: string
Return values
string —PDF command
getOutGradientShaders()
Get the PDF output string for gradient shaders
public getOutGradientShaders(int $pon)
: string
Parameters
- $pon : int
-
Current PDF Object Number
Return values
string —PDF command
getOverprint()
Get overprint mode for stroking (OP) and non-stroking (op) painting operations.
public getOverprint([bool $stroking
= true
][,
bool $nonstroking
= ''
], int $mode)
: string
(Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
Parameters
- $stroking : bool = true
-
If true apply overprint for stroking operations.
- $nonstroking : bool = ''
-
If true apply overprint for painting operations other than stroking.
- $mode : int
-
Overprint mode: 0 = each source colour component value replaces the value previously painted for the corresponding device colorant; 1 = a tint value of 0.0 for a source colour component shall leave the corresponding component of the previously painted colour unchanged.
Return values
string —PDF command
getPathPaintOp()
Get the Path-Painting Operators.
public getPathPaintOp(string $mode[,
string $default
= 'S'
]) : string
Parameters
- $mode : string
-
Mode of rendering. Possible values are:
- S or D: Stroke the path.
- s or d: Close and stroke the path.
- f or F: Fill the path, using the nonzero winding number rule to determine the region to fill.
- f* or F*: Fill the path, using the even-odd rule to determine the region to fill.
- B or FD or DF: Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill.
- B* or FD or DF: Fill and then stroke the path, using the even-odd rule to determine the region to fill.
- b or fd or df: Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill.
- b or fd or df: Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill.
- CNZ: Clipping mode using the even-odd rule to determine which regions lie inside the clipping path.
- CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path
- n: End the path object without filling or stroking it.
- $default : string = 'S'
-
Default style
Return values
string —getPointMirroring()
Point reflection mirroring.
public getPointMirroring(float $posx,
float $posy)
: string
Parameters
- $posx : float
-
Abscissa of the mirroring point.
- $posy : float
-
Ordinate of the mirroring point.
Return values
string —Transformation string
getPropScaling()
Vertical and horizontal proportional Scaling.
public getPropScaling(float $skf,
float $posx,
float $posy)
: string
Parameters
- $skf : float
-
Scaling factor.
- $posx : float
-
Abscissa of the scaling center.
- $posy : float
-
Ordinate of the scaling center.
Return values
string —Transformation string
getRadialGradient()
Get a radial colour gradient command.
public getRadialGradient(float $posx,
float $posy,
float $width,
float $height,
string $colorstart,
string $colorend[,
array<string|int,
mixed> $coords
= array(0.5, 0.5,
0.5, 0.5, 1) ])
: string
Parameters
- $posx : float
-
Abscissa of the top left corner of the rectangle.
- $posy : float
-
Ordinate of the top left corner of the rectangle.
- $width : float
-
Width of the rectangle.
- $height : float
-
Height of the rectangle.
- $colorstart : string
-
Starting color.
- $colorend : string
-
Ending color.
- $coords : array<string|int, mixed> = array(0.5, 0.5, 0.5, 0.5, 1)
-
Array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with $colorstart (be inside the circle), (cx, cy) is the center of the circle with $colorend, and r is the radius of the circle.
Return values
string —PDF command
getRawCurve()
Append a cubic Bezier curve to the current path.
public getRawCurve(float $posx1,
float $posy1,
float $posx2,
float $posy2,
float $posx3,
float $posy3)
: string
The curve shall extend from the current point to the point (posx3, posy3), using (posx1, posy1) and (posx2, posy2) as the Bezier control points. The new current point shall be (posx3, posy3).
Parameters
- $posx1 : float
-
Abscissa of control point 1.
- $posy1 : float
-
Ordinate of control point 1.
- $posx2 : float
-
Abscissa of control point 2.
- $posy2 : float
-
Ordinate of control point 2.
- $posx3 : float
-
Abscissa of end point.
- $posy3 : float
-
Ordinate of end point.
Return values
string —PDF command
getRawCurveV()
Append a cubic Bezier curve to the current path.
public getRawCurveV(float $posx2,
float $posy2,
float $posx3,
float $posy3)
: string
The curve shall extend from the current point to the point (posx3, posy3), using the current point and (posx2, posy2) as the Bezier control points. The new current point shall be (posx3, posy3).
Parameters
- $posx2 : float
-
Abscissa of control point 2.
- $posy2 : float
-
Ordinate of control point 2.
- $posx3 : float
-
Abscissa of end point.
- $posy3 : float
-
Ordinate of end point.
Return values
string —PDF command
getRawCurveY()
Append a cubic Bezier curve to the current path.
public getRawCurveY(float $posx1,
float $posy1,
float $posx3,
float $posy3)
: string
The curve shall extend from the current point to the point (posx3, posy3), using (posx1, posy1) and (posx3, posy3) as the Bezier control points. The new current point shall be (posx3, posy3).
Parameters
- $posx1 : float
-
Abscissa of control point 1.
- $posy1 : float
-
Ordinate of control point 1.
- $posx3 : float
-
Abscissa of end point.
- $posy3 : float
-
Ordinate of end point.
Return values
string —PDF command
getRawEllipticalArc()
Append an elliptical arc to the current path.
public getRawEllipticalArc(float $posxc,
float $posyc,
float $rdh,
float $rdv,
float $posxang,
float $angs[,
float $angf
= 360
][,
bool $pie
= false
][,
int $ncv
= 2
][,
bool $startpoint
= true
][,
bool $ccw
= true
][,
bool $svg
= false
][,
array<string|int,
mixed> &$bbox
= array()
]) : string
An ellipse is formed from n Bezier curves.
Parameters
- $posxc : float
-
Abscissa of center point.
- $posyc : float
-
Ordinate of center point.
- $rdh : float
-
Horizontal radius.
- $rdv : float
-
Vertical radius (if = 0 then it is a circle).
- $posxang : float
-
Angle between the X-axis and the major axis of the ellipse.
- $angs : float
-
Angle in degrees at which starting drawing.
- $angf : float = 360
-
Angle in degrees at which stop drawing.
- $pie : bool = false
-
If true do not mark the border point (used to draw pie sectors).
- $ncv : int = 2
-
Number of curves used to draw a 90 degrees portion of ellipse.
- $startpoint : bool = true
-
If true output a starting point.
- $ccw : bool = true
-
If true draws in counter-clockwise direction.
- $svg : bool = false
-
If true the angles are in svg mode (already calculated).
- $bbox : array<string|int, mixed> = array()
-
If provided, it will be filled with the bounding box coordinates (x min, y min, x max, y max).
Tags
Return values
string —PDF command
getRawLine()
Append a straight line segment from the current point to the specified one.
public getRawLine(float $posx,
float $posy)
: string
The new current point shall be the one specified.
Parameters
- $posx : float
-
Abscissa of end point.
- $posy : float
-
Ordinate of end point.
Return values
string —PDF command
getRawPoint()
Begin a new subpath by moving the current point to the specified coordinates, omitting any connecting line segment.
public getRawPoint(float $posx,
float $posy)
: string
Parameters
- $posx : float
-
Abscissa of point.
- $posy : float
-
Ordinate of point.
Return values
string —PDF command
getRawRect()
Append a rectangle to the current path as a complete subpath, with lower-left corner in the specified point and dimensions width and height in user units.
public getRawRect(float $posx,
float $posy,
float $width,
float $height)
: string
Parameters
- $posx : float
-
Abscissa of upper-left corner.
- $posy : float
-
Ordinate of upper-left corner.
- $width : float
-
Width.
- $height : float
-
Height.
Return values
string —PDF command
getReflection()
Reflection against a straight line through point (x, y) with the gradient angle (angle).
public getReflection(mixed $ang,
float $posx,
float $posy)
: string
Parameters
- $ang : mixed
- $posx : float
-
Abscissa of the mirroring point.
- $posy : float
-
Ordinate of the mirroring point.
Return values
string —Transformation string
getRotation()
Rotation.
public getRotation(float $angle,
float $posx,
float $posy)
: string
Parameters
- $angle : float
-
Angle in degrees for counter-clockwise rotation.
- $posx : float
-
Abscissa of the rotation center.
- $posy : float
-
Ordinate of the rotation center.
Return values
string —Transformation string
getScaling()
Vertical and horizontal non-proportional Scaling.
public getScaling(float $skx,
float $sky,
float $posx,
float $posy)
: string
Parameters
- $skx : float
-
Horizontal scaling factor.
- $sky : float
-
vertical scaling factor.
- $posx : float
-
Abscissa of the scaling center.
- $posy : float
-
Ordinate of the scaling center.
Return values
string —Transformation string
getSkewing()
Skew.
public getSkewing(float $angx,
float $angy,
float $posx,
float $posy)
: string
Parameters
- $angx : float
-
Angle in degrees between -90 (skew to the left) and 90 (skew to the right)
- $angy : float
-
Angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
- $posx : float
-
Abscissa of the skewing center.
- $posy : float
-
Ordinate of the skewing center.
Return values
string —Transformation string
getStartTransform()
Starts a 2D transformation saving current graphic state.
public getStartTransform()
: string
This function must be called before calling transformation methods
Return values
string —getStopTransform()
Stops a 2D tranformation restoring previous graphic state.
public getStopTransform()
: string
This function must be called after calling transformation methods.
Return values
string —getStyle()
Returns the PDF string of the last style added.
public getStyle()
: string
Return values
string —getStyleCmd()
Returns the PDF string of the specified style.
public getStyleCmd(array<string|int,
mixed> $style)
: string
Parameters
- $style : array<string|int, mixed>
-
Style to represent.
Return values
string —getTransformation()
Get the tranformation matrix (CTM) PDF string
public getTransformation(array<string|int,
mixed> $ctm)
: string
Parameters
- $ctm : array<string|int, mixed>
-
Transformation matrix array.
Return values
string —getTransformIndex()
Returns the transformation stack index.
public getTransformIndex()
: int
Return values
int —getTransformStack()
Returns the transformation stack.
public getTransformStack()
: array<string|int,
mixed>
Return values
array<string|int, mixed> —getTranslation()
Translate graphic object horizontally and vertically.
public getTranslation(float $trx,
float $try)
: string
Parameters
- $trx : float
-
Movement to the right.
- $try : float
-
Movement to the bottom.
Return values
string —Transformation string
getVectorsAngle()
Returns the angle in radiants between two vectors with the same origin point.
public getVectorsAngle(int $posx1,
int $posy1,
int $posx2,
int $posy2)
: float
Angles are counted counter-clock wise.
Parameters
- $posx1 : int
-
X coordinate of first vector point.
- $posy1 : int
-
Y coordinate of first vector point.
- $posx2 : int
-
X coordinate of second vector point.
- $posy2 : int
-
Y coordinate of second vector point.
Return values
float —Angle in radiants
getVertMirroring()
Verical Mirroring.
public getVertMirroring(float $posy)
: string
Parameters
- $posy : float
-
Ordinate of the mirroring line.
Return values
string —Transformation string
getVertScaling()
Vertical Scaling.
public getVertScaling(float $sky,
float $posx,
float $posy)
: string
Parameters
- $sky : float
-
vertical scaling factor.
- $posx : float
-
Abscissa of the scaling center.
- $posy : float
-
Ordinate of the scaling center.
Return values
string —Transformation string
getVertSkewing()
Skew vertically.
public getVertSkewing(float $angy,
float $posx,
float $posy)
: string
Parameters
- $angy : float
-
Angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
- $posx : float
-
Abscissa of the skewing center.
- $posy : float
-
Ordinate of the skewing center.
Return values
string —Transformation string
getVertTranslation()
Translate graphic object vertically.
public getVertTranslation(float $try)
: string
Parameters
- $try : float
-
Movement to the bottom.
Return values
string —Transformation string
init()
Initialize objects
public abstract init()
: mixed
Return values
mixed —isClosingMode()
Returns true if the specified mode includes "closing the path" option
public isClosingMode(string $mode)
: bool
Parameters
- $mode : string
-
Path paint operator (mode of rendering).
Return values
bool —isFillingMode()
Returns true if the specified path paint operator includes the filling option
public isFillingMode(string $mode)
: bool
Parameters
- $mode : string
-
Path paint operator (mode of rendering).
Return values
bool —isStrokingMode()
Returns true if the specified mode includes the stroking option
public isStrokingMode(string $mode)
: bool
Parameters
- $mode : string
-
Path paint operator (mode of rendering).
Return values
bool —pop()
Remove and return last style
public pop()
: string
Return values
string —PDF style string
restoreStyleStaus()
Restore the saved style status
public restoreStyleStaus()
: mixed
Return values
mixed —saveStyleStaus()
Save the current style ID to be restored later
public saveStyleStaus()
: mixed
Return values
mixed —setKUnit()
Set unit of measure conversion ratio.
public setKUnit(float $kunit)
: mixed
Parameters
- $kunit : float
-
Unit of measure conversion ratio.
Return values
mixed —setPageHeight()
Set page height
public setPageHeight(float $pageh)
: mixed
Parameters
- $pageh : float
-
Page height
Return values
mixed —setPageWidth()
Set page width
public setPageWidth(float $pagew)
: mixed
Parameters
- $pagew : float
-
Page width
Return values
mixed —getGradientStops()
Process the gradient stops.
protected getGradientStops(array<string|int,
mixed> $grad,
array<string|int,
mixed> $stops)
: array<string|int,
mixed>
Parameters
- $grad : array<string|int, mixed>
-
Array containing gradient info
- $stops : array<string|int, mixed>
-
Array gradient color components: color = color; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1).
Return values
array<string|int, mixed> —Gradient array.
getLineModeCmd()
Returns the PDF string of the specified line style
protected getLineModeCmd(array<string|int,
mixed> $style)
: string
Parameters
- $style : array<string|int, mixed>
-
Style to represent.
Return values
string —getOutGradientCols()
Get the PDF output string for gradient colors and transparency
protected getOutGradientCols(array<string|int,
mixed> $grad,
string $type)
: string
Parameters
- $grad : array<string|int, mixed>
-
Array of gradient colors
- $type : string
-
Type of output: 'color' or 'opacity'
Return values
string —PDF command
getOutPatternObj()
Get the PDF output string for the pattern and shading object
protected getOutPatternObj(array<string|int,
mixed> $grad,
int $objref)
: string
Parameters
- $grad : array<string|int, mixed>
-
Array of gradient colors
- $objref : int
-
Refrence object number
Return values
string —PDF command
setRawEllipticalArcAngles()
Initialize angles for the elliptical arc.
protected setRawEllipticalArcAngles(float &$ags,
float &$agf,
float $rdv,
float $rdh,
bool $ccw,
bool $svg)
: mixed
Parameters
- $ags : float
-
Angle in degrees at which starting drawing.
- $agf : float
-
Angle in degrees at which stop drawing.
- $rdv : float
-
Vertical radius (if = 0 then it is a circle).
- $rdh : float
-
Horizontal radius.
- $ccw : bool
-
If true draws in counter-clockwise direction.
- $svg : bool
-
If true the angles are in svg mode (already calculated).