Style

Com\Tecnick\Pdf\Graph\Style

Namespace: Com\Tecnick\Pdf\Graph

Extends: Base

Abstract: Yes

File: Style.php line 38

Tags

Constants

IDMATRIX

File: Base.php line 101

public TTMatrix IDMATRIX = [1.0, 0.0, 0.0, 1.0, 0.0, 0.0]

MPI

File: Base.php line 94

public float MPI = 3.141592653589793

Methods

__construct()

File: Base.php line 191

public __construct(float $kunit, float $pagew, float $pageh, Pdf $pdfColor, Encrypt $encrypt[, bool $notransparency = false ][, bool $compress = true ]) : mixed

Parameters

  • $kunit : float: Unit of measure conversion ratio.
  • $pagew : float: Page width.
  • $pageh : float: Page height.
  • $pdfColor : Pdf: Color object.
  • $encrypt : Encrypt: Encrypt object.
  • $notransparency : bool = false: True when the conformance mode forbids transparency (PDF/A-1, PDF/X-1a, PDF/X-3): alpha, blend modes and soft masks are suppressed. Shadings stay available.
  • $compress : bool = true: Set to false to disable stream compression.

Tags

add()

File: Style.php line 233

public add([StyleDataOpt $style = [] ][, bool $inheritlast = false ]) : string

Parameters

  • $style : StyleDataOpt = []: Style to add.
  • $inheritlast : bool = false: If true inherit missing values from the last style.

Return values

string —

PDF style string

getCurrentStyleArray()

File: Style.php line 290

public getCurrentStyleArray() : StyleDataOpt

Return values

StyleDataOpt

getCurrentStyleItem()

File: Style.php line 331

public getCurrentStyleItem(string $item) : mixed

Parameters

  • $item : string: Item to search.

Tags

getDefaultStyle()

File: Base.php line 227

public getDefaultStyle([StyleDataOpt $style = [] ]) : StyleData

Parameters

  • $style : StyleDataOpt = []: Style parameters to merge to the default ones.

Return values

StyleData

getExtGState()

File: Style.php line 606

public getExtGState(array<string, int|float|bool|string> $parms) : string

Parameters

  • $parms : array<string, int|float|bool|string>: parameters.

Return values

string —

PDF command.

getLastExtGStateID()

File: Base.php line 355

public getLastExtGStateID() : int|null

Return values

int|null

getLastStyleProperty()

File: Style.php line 307

public getLastStyleProperty(string $property[, int|float|bool|string|null $default = null ]) : int|float|bool|string|null

Parameters

  • $property : string: Property to search.
  • $default : int|float|bool|string|null = null: Default value to return in case the property is not found.

Return values

int|float|bool|string|null —

Property value or $default in case the property is not found.

getModeWithClose()

File: Style.php line 524

public getModeWithClose(string|PathPaintOp $mode) : string

Modes that do not stroke, or that already close, are returned unchanged.

Parameters

Return values

string

getModeWithoutClose()

File: Style.php line 544

public getModeWithoutClose(string|PathPaintOp $mode) : string

Parameters

Return values

string

getModeWithoutFill()

File: Style.php line 564

public getModeWithoutFill(string|PathPaintOp $mode) : string

Parameters

Return values

string

getModeWithoutStroke()

File: Style.php line 584

public getModeWithoutStroke(string|PathPaintOp $mode) : string

Parameters

Return values

string

getObjectNumber()

File: Base.php line 268

public getObjectNumber() : int

Return values

int

getOutExtGState()

File: Base.php line 325

public getOutExtGState(int $pon) : string

Parameters

  • $pon : int: Current PDF Object Number

Return values

string —

PDF command

getOutExtGStateResources()

File: Base.php line 437

public getOutExtGStateResources() : string

Return values

string —

PDF command

getOutExtGStateResourcesByKeys()

File: Base.php line 449

public getOutExtGStateResourcesByKeys(array<string|int, int> $keys) : string

Parameters

  • $keys : array<string|int, int>: Array of extgstates keys.

Return values

string —

PDF command

getOutGradientResources()

File: Base.php line 502

public getOutGradientResources() : string

Return values

string —

PDF command

getOutGradientResourcesByKeys()

File: Base.php line 514

public getOutGradientResourcesByKeys(array<string|int, int> $keys) : string

Parameters

  • $keys : array<string|int, int>: Array of gradient keys.

Return values

string —

PDF command

getOutGradientShaders()

File: Base.php line 782

public getOutGradientShaders(int $pon) : string

Parameters

  • $pon : int: Current PDF Object Number

Tags

  • throws: Exception

Return values

string —

PDF command

getPathPaintOp()

File: Style.php line 437

public getPathPaintOp(string|PathPaintOp $mode[, string|PathPaintOp $default = 'S' ]) : string

Parameters

  • $mode : string|PathPaintOp : 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; - f* or F*: fill the path, using the even-odd rule; - B or FD or DF: fill and then stroke the path, using the nonzero winding number rule; - B* or FD or DF: fill and then stroke the path, using the even-odd rule; - b or fd or df: close, fill and then stroke the path, using the nonzero winding number rule; - b* or fd or df: close, fill and then stroke the path, using the even-odd rule; - CNZ: clipping mode using the nonzero winding number rule; - CEO: clipping mode using the even-odd rule; - h: close the path; - n: end the path object without filling or stroking it.
  • $default : string|PathPaintOp = ‘S’: Mode to use when $mode is empty or unknown.

Return values

string

getStyle()

File: Style.php line 344

public getStyle() : string

Return values

string

getStyleCmd()

File: Style.php line 354

public getStyleCmd([StyleDataOpt $style = [] ]) : string

Parameters

  • $style : StyleDataOpt = []: Style to represent.

Return values

string

getTransparencyExtGStateNames()

File: Base.php line 368

public getTransparencyExtGStateNames() : array<int, string>

The names match the tokens used by the “gs” operator (for example “GS3”).

Return values

array<int, string> —

List of ExtGState resource names.

initStyle()

File: Base.php line 215

public initStyle() : void

isClippingMode()

File: Style.php line 507

public isClippingMode(string|PathPaintOp $mode) : bool

Parameters

Return values

bool

isClosingMode()

File: Style.php line 493

public isClosingMode(string|PathPaintOp $mode) : bool

Parameters

Return values

bool

isFillingMode()

File: Style.php line 463

public isFillingMode(string|PathPaintOp $mode) : bool

Parameters

Return values

bool

isStrokingMode()

File: Style.php line 477

public isStrokingMode(string|PathPaintOp $mode) : bool

Parameters

Return values

bool

pop()

File: Style.php line 250

public pop() : string

Tags

Return values

string —

PDF style string.

restoreStyleStatus()

File: Style.php line 273

public restoreStyleStatus() : void

saveStyleStatus()

File: Style.php line 265

public saveStyleStatus() : void

setKUnit()

File: Base.php line 308

public setKUnit(float $kunit) : static

Parameters

  • $kunit : float: Unit of measure conversion ratio. Must be greater than zero.

Tags

Return values

static

setPageHeight()

File: Base.php line 280

public setPageHeight(float $pageh) : float

Parameters

  • $pageh : float: Page height.

Return values

float —

previous page height value.

setPageWidth()

File: Base.php line 294

public setPageWidth(float $pagew) : float

Parameters

  • $pagew : float: Page width.

Return values

float —

previous page width value.