Transform

Com\Tecnick\Pdf\Graph\Transform

Namespace: Com\Tecnick\Pdf\Graph

Extends: Style

Abstract: Yes

File: Transform.php line 36

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 189

public __construct(float $kunit, float $pagew, float $pageh, Pdf $pdfColor, Encrypt $encrypt[, bool $pdfa = 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.
  • $pdfa : bool = false: True if we are in PDF/A mode.
  • $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

degToRad()

File: Transform.php line 393

public degToRad(float $deg) : float

Parameters

  • $deg : float: Angular value in degrees.

Return values

float —

Angle in radians

getCtmProduct()

File: Transform.php line 374

public getCtmProduct(TTMatrix $tma, TTMatrix $tmb) : TTMatrix

Parameters

  • $tma : TTMatrix: First Transformation Matrix.
  • $tmb : TTMatrix: Second Transformation Matrix.

Return values

TTMatrix —

CTM Transformation Matrix.

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 225

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.

getHorizMirroring()

File: Transform.php line 216

public getHorizMirroring(float $posx) : string

Parameters

  • $posx : float: Abscissa of the mirroring line.

Tags

Return values

string —

Transformation string

getHorizScaling()

File: Transform.php line 147

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.

Tags

Return values

string —

Transformation string

getHorizSkewing()

File: Transform.php line 345

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.

Tags

Return values

string —

Transformation string

getHorizTranslation()

File: Transform.php line 287

public getHorizTranslation(float $trx) : string

Parameters

  • $trx : float: Movement to the right.

Return values

string —

Transformation string

getLastExtGStateID()

File: Base.php line 353

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 266

public getObjectNumber() : int

Return values

int

getOutExtGState()

File: Base.php line 323

public getOutExtGState(int $pon) : string

Parameters

  • $pon : int: Current PDF Object Number

Return values

string —

PDF command

getOutExtGStateResources()

File: Base.php line 435

public getOutExtGStateResources() : string

Return values

string —

PDF command

getOutExtGStateResourcesByKeys()

File: Base.php line 447

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 500

public getOutGradientResources() : string

Return values

string —

PDF command

getOutGradientResourcesByKeys()

File: Base.php line 512

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 780

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

getPointMirroring()

File: Transform.php line 245

public getPointMirroring(float $posx, float $posy) : string

Parameters

  • $posx : float: Abscissa of the mirroring point.
  • $posy : float: Ordinate of the mirroring point.

Tags

Return values

string —

Transformation string

getPropScaling()

File: Transform.php line 179

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.

Tags

Return values

string —

Transformation string

getReflection()

File: Transform.php line 261

public getReflection(float $ang, float $posx, float $posy) : string

Parameters

  • $ang : float: Gradient angle in degrees of the straight line.
  • $posx : float: Abscissa of the mirroring point.
  • $posy : float: Ordinate of the mirroring point.

Tags

Return values

string —

Transformation string

getRotation()

File: Transform.php line 193

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()

File: Transform.php line 124

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.

Tags

Return values

string —

Transformation string

getSkewing()

File: Transform.php line 316

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.

Tags

Return values

string —

Transformation string

getStartTransform()

File: Transform.php line 73

public getStartTransform() : string

This function must be called before calling transformation methods

Return values

string

getStopTransform()

File: Transform.php line 84

public getStopTransform() : string

This function must be called after calling transformation methods.

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

getTransformation()

File: Transform.php line 103

public getTransformation(TTMatrix $ctm) : string

The matrix is recorded on the transformation stack only when a block opened by getStartTransform() is active.

Parameters

  • $ctm : TTMatrix: Transformation matrix array.

Return values

string

getTransformIndex()

File: Transform.php line 64

public getTransformIndex() : int

Return values

int

getTransformStack()

File: Transform.php line 56

public getTransformStack() : array<int, array<int, TTMatrix>>

Return values

array<int, array<int, TTMatrix»

getTranslation()

File: Transform.php line 274

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

getTransparencyExtGStateNames()

File: Base.php line 366

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.

getVertMirroring()

File: Transform.php line 230

public getVertMirroring(float $posy) : string

Parameters

  • $posy : float: Ordinate of the mirroring line.

Tags

Return values

string —

Transformation string

getVertScaling()

File: Transform.php line 163

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.

Tags

Return values

string —

Transformation string

getVertSkewing()

File: Transform.php line 361

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.

Tags

Return values

string —

Transformation string

getVertTranslation()

File: Transform.php line 299

public getVertTranslation(float $try) : string

Parameters

  • $try : float: Movement to the bottom.

Return values

string —

Transformation string

initStyle()

File: Base.php line 213

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 306

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 278

public setPageHeight(float $pageh) : float

Parameters

  • $pageh : float: Page height.

Return values

float —

previous page height value.

setPageWidth()

File: Base.php line 292

public setPageWidth(float $pagew) : float

Parameters

  • $pagew : float: Page width.

Return values

float —

previous page width value.