Style extends Base
Com\Tecnick\Pdf\Graph\Style
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
- $enc : Encrypt
- Encrypt object
- $extgstates : array<string|int, mixed>
- Array of transparency objects and parameters.
- $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
- 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
- getLastStyleProperty() : mixed
- Returns the last set value of the specified property
- 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
- getPathPaintOp() : string
- Get the Path-Painting Operators.
- getStyle() : string
- Returns the PDF string of the last style added.
- getStyleCmd() : string
- Returns the PDF string of the specified style.
- init() : mixed
- Initialize default style
- 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
- 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
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
$enc
Encrypt object
protected Encrypt
$enc
$extgstates
Array of transparency objects and parameters.
protected array<string|int,
mixed> $extgstates = 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
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
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
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
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 —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 —init()
Initialize default style
public 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 —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