setasign\SetaPDF2\Core\Canvas
Text A canvas helper class for text operators
File: /SetaPDF v2/Core/Canvas/Text.php
Old class name (alias):
\SetaPDF_Core_Canvas_Text
Class hierarchy
Summary
Methods
- __construct()
- addCurrentTransformationMatrix()
- begin()
- beginText()
- cleanUp()
- draw()
- end()
- endText()
- markedContent()
- moveToNextLine()
- moveToNextLineAndShowText()
- moveToStartOfNextLine()
- path()
- restoreGraphicState()
- rotate()
- saveGraphicState()
- scale()
- setCharSpacing()
- setCharacterSpacing()
- setColor()
- setFont()
- setGraphicState()
- setLeading()
- setNonStrokingColor()
- setRenderingMode()
- setRise()
- setScaling()
- setStrokingColor()
- setTextMatrix()
- setTextRise()
- setWordSpacing()
- showText()
- showTextStrings()
- skew()
- text()
- translate()
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()
addCurrentTransformationMatrix()
float|int $b,
float|int $c,
float|int $d,
float|int $e,
float|int $f
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
moveToNextLine()
float $y,
bool $setLeading = false
Move to the next line.
Parameters
- $x : float
- $y : float
- $setLeading : bool
moveToNextLineAndShowText()
float $wordSpacing = null,
float $charSpacing = null
Move to the next line and show text.
Parameters
- $text : string|string[]
- $wordSpacing : float
- $charSpacing : float
Exceptions
rotate()
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
scale()
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()
WARNING: This method is marked as deprecated!
Alias for setCharacterSpacing()
Parameters
- $charSpacing : float
See
setColor()
Proxy method for setting the color on the canvas.
Parameters
- $color : \SetaPDF_Core_DataStructure_Color|int[]|int|string
- $stroking : bool
See
setFont()
Set the font.
Parameters
- $name : string|\SetaPDF_Core_Font_FontInterface
- $size : float
Exceptions
Throws \setasign\SetaPDF2\Core\Font\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
setGraphicState()
Proxy method for setting a graphic state on the canvas.
Parameters
- $graphicState : \SetaPDF_Core_Resource_ExtGState
See
setNonStrokingColor()
Proxy method for setting the non-stroking color on the canvas.
Parameters
- $color : \SetaPDF_Core_DataStructure_Color|int[]|int|string
See
setRenderingMode()
Set the rendering mode.
The available rendering modes are also available through class constants such as Text::RENDERING_MODE_CLIP.
Parameters
- $renderingMode : int
See
- PDF reference 32000-1:2008 9.3.6 Text Rendering Mode
setStrokingColor()
Proxy method for setting the stroking color on the canvas.
Parameters
- $color : \SetaPDF_Core_DataStructure_Color|int[]|int|string
See
setTextMatrix()
float $b,
float $c,
float $d,
float $e,
float $f
Set the text matrix.
Parameters
- $a : float
- $b : float
- $c : float
- $d : float
- $e : float
- $f : float
setTextRise()
WARNING: This method is marked as deprecated!
Alias for setRise()
Parameters
- $textRise : float
See
setWordSpacing()
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
skew()
int|float $angleY,
int|float $x = 0,
int|float $y = 0
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
translate()
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