SetaPDF_Core_Canvas_Text A canvas helper class for text operators

File: /SetaPDF v2/Core/Canvas/Text.php

Class hierarchy

Summary

Constants

RENDERING_MODE_CLIP

Rendering mode

RENDERING_MODE_FILL

Rendering mode

RENDERING_MODE_FILL_AND_CLIP

Rendering mode

RENDERING_MODE_FILL_AND_STROKE

Rendering mode

RENDERING_MODE_FILL_STROKE_AND_CLIP

Rendering mode

RENDERING_MODE_INVISIBLE

Rendering mode

RENDERING_MODE_STROKE

Rendering mode

RENDERING_MODE_STROKE_AND_CLIP

Rendering mode


Properties

$_canvas

The origin canvas object


Methods

__construct()

The constructor.

Parameters
$canvas : SetaPDF_Core_Canvas
 

addCurrentTransformationMatrix()

public SetaPDF_Core_Canvas_StandardOperators::addCurrentTransformationMatrix (
float|int $a, float|int $b, float|int $c, float|int $d, float|int $e, float|int $f
): $this

Proxy method for adding a transformation matrix on the canvas.

Parameters
$a : float|int
 
$b : float|int
 
$c : float|int
 
$d : float|int
 
$e : float|int
 
$f : float|int
 
See

begin()

Begin a text object.

cleanUp()

public SetaPDF_Core_Canvas_Operators::cleanUp (
void
): void

Release objects to free memory and cycled references.

After calling this method the instance of this object is unusable!

draw()

Get the draw helper.

end()

End a text object.

moveToNextLine()

public SetaPDF_Core_Canvas_Text::moveToNextLine (
float $x, float $y [, boolean $setLeading = false ]
): SetaPDF_Core_Canvas_Text

Move to the next line.

Parameters
$x : float
 
$y : float
 
$setLeading : boolean
 

moveToNextLineAndShowText()

public SetaPDF_Core_Canvas_Text::moveToNextLineAndShowText (
string|string[] $text [, float $wordSpacing = null [, float $charSpacing = null ]]
): SetaPDF_Core_Canvas_Text

Move to the next line and show text.

Parameters
$text : string|string[]
 
$wordSpacing : float
 
$charSpacing : float
 
Exceptions

Throws SetaPDF_Core_Exception

moveToStartOfNextLine()

Move to the start of the next line.

path()

Get the path helper.

restoreGraphicState()

Proxy method for restoring the graphic state on the canvas.

See

rotate()

public SetaPDF_Core_Canvas_StandardOperators::rotate (
int|float $x, int|float $y, int|float $angle
): $this

Proxy method for rotating the transformation matrix on the canvas.

Parameters
$x : int|float

X-coordinate of rotation point

$y : int|float

Y-coordinate of rotation point

$angle : int|float

Angle to rotate in degrees

See

saveGraphicState()

Proxy method for saving the graphic state on the canvas.

See

scale()

public SetaPDF_Core_Canvas_StandardOperators::scale (
int|float $scaleX, int|float $scaleY
): $this

Proxy method for scaling the transformation matrix on the canvas.

Parameters
$scaleX : int|float

Scale factor on X

$scaleY : int|float

Scale factor on Y

See

setCharSpacing()

public SetaPDF_Core_Canvas_Text::setCharSpacing (
[ float $charSpacing = 0.0 ]
): SetaPDF_Core_Canvas_Text

Alias for setCharacterSpacing()

Parameters
$charSpacing : float
 
See

setCharacterSpacing()

Set the char spacing.

Parameters
$charSpacing : float
 

setColor()

public SetaPDF_Core_Canvas_StandardOperators::setColor (
SetaPDF_Core_DataStructure_Color|int[]|int|string $color [, boolean $stroking = true ]
): $this

Proxy method for setting the color on the canvas.

Parameters
$color : SetaPDF_Core_DataStructure_Color|int[]|int|string
 
$stroking : boolean
 
See

setGraphicState()

Proxy method for setting a graphic state on the canvas.

Parameters
$graphicState : SetaPDF_Core_Resource_ExtGState
 
See

setLeading()

public SetaPDF_Core_Canvas_Text::setLeading (
[ float $leading = 0.0 ]
): SetaPDF_Core_Canvas_Text

Set the leading.

Parameters
$leading : float
 

setNonStrokingColor()

Proxy method for setting the non-stroking color on the canvas.

Parameters
$color : SetaPDF_Core_DataStructure_Color|int[]|int|string
 
See

setRenderingMode()

public SetaPDF_Core_Canvas_Text::setRenderingMode (
[ integer $renderingMode = 0 ]
): SetaPDF_Core_Canvas_Text

Set the rendering mode.

The available rendering modes are also available through class constants such as SetaPDF_Core_Canvas_Text::RENDERING_MODE_CLIP.

Parameters
$renderingMode : integer
 
See
  • PDF reference 32000-1:2008 9.3.6 Text Rendering Mode

setRise()

public SetaPDF_Core_Canvas_Text::setRise (
[ float $rise = 0.0 ]
): SetaPDF_Core_Canvas_Text

Set text rise.

Parameters
$rise : float
 

setScaling()

public SetaPDF_Core_Canvas_Text::setScaling (
[ float $scaling = 100.0 ]
): SetaPDF_Core_Canvas_Text

Set the horizontal scaling.

Parameters
$scaling : float
 

setStrokingColor()

Proxy method for setting the stroking color on the canvas.

Parameters
$color : SetaPDF_Core_DataStructure_Color|int[]|int|string
 
See

setTextMatrix()

public SetaPDF_Core_Canvas_Text::setTextMatrix (
float $a, float $b, float $c, float $d, float $e, float $f
): SetaPDF_Core_Canvas_Text

Set the text matrix.

Parameters
$a : float
 
$b : float
 
$c : float
 
$d : float
 
$e : float
 
$f : float
 

setTextRise()

public SetaPDF_Core_Canvas_Text::setTextRise (
[ float $textRise = 0.0 ]
): SetaPDF_Core_Canvas_Text

Alias for setRise()

Parameters
$textRise : float
 
See

setWordSpacing()

public SetaPDF_Core_Canvas_Text::setWordSpacing (
[ float $wordSpacing = 0.0 ]
): SetaPDF_Core_Canvas_Text

Set the word spacing.

You shall notice that this word spacing property affects the character which is assigned to "\x20" of a font which uses a single byte encoding. When e.g. using subset fonts this setting will end in unwanted results.

Parameters
$wordSpacing : float
 

showText()

Show text.

Parameters
$text : string|string[]
 
Exceptions

Throws SetaPDF_Core_Exception

showTextStrings()

Shows text strings.

Parameters
$textStrings : array|string
 
Exceptions

Throws SetaPDF_Core_Exception

skew()

public SetaPDF_Core_Canvas_StandardOperators::skew (
int|float $angleX, int|float $angleY [, int|float $x = 0 [, int|float $y = 0 ]]
): $this

Proxy method for skewing the transformation matrix on the canvas.

Parameters
$angleX : int|float

Angle to x-axis in degrees

$angleY : int|float

Angle to y-axis in degrees

$x : int|float

Points to stretch on x-axis

$y : int|float

Point to stretch on y-axis

See

text()

Get the text helper.

translate()

public SetaPDF_Core_Canvas_StandardOperators::translate (
int|float $shiftX, int|float $shiftY
): $this

Proxy method for moving the transformation matrix on the canvas.

Parameters
$shiftX : int|float

Points to move on x-axis

$shiftY : int|float

Points to move on y-axis

See