Text
in package
Pdf page text class
Tags
Table of Contents
Properties
- $alignment : Alignment|null
- Text alignment object
- $charWrap : int
- Basic wrap based on character length
- $fillColor : ColorInterface|null
- Text fill color
- $leading : int
- Leading for the lines for a character wrap
- $size : int|float
- Text font size
- $stream : Stream|null
- Text stream object
- $string : string|null
- Text string value
- $strings : array<string|int, mixed>
- Text strings as array for streaming
- $stringsWithOffsets : array<string|int, mixed>
- Text strings with offset values
- $stroke : array<string|int, mixed>
- Text stroke
- $strokeColor : ColorInterface|null
- Text stroke color
- $textParams : array<string|int, mixed>
- Text parameters
- $wrap : Wrap|null
- Text wrap object
Methods
- __construct() : mixed
- Constructor
- addStringWithOffset() : Text
- Add a string with offset
- endStream() : string
- End the text stream
- escape() : Text
- Escape string
- getAlignment() : Alignment|null
- Get text alignment
- getCharWrap() : int
- Get character wrap
- getColorStream() : string
- Get the partial color stream
- getFillColor() : ColorInterface|null
- Get the text fill color
- getLeading() : int
- Get character wrap leading
- getNumberOfWrappedLines() : int
- Get number of wrapped lines from character wrap
- getPartialStream() : string
- Get the partial text stream
- getRotation() : int
- Get the rotation of the text
- getSize() : int|float
- Get the text size
- getStream() : string
- Get the text stream
- getString() : string|null
- Get the text string
- getStrings() : array<string|int, mixed>
- Get the text string array
- getStringsWithOffset() : array<string|int, mixed>
- Get strings with offset
- getStroke() : array<string|int, mixed>
- Get the text stroke properties
- getStrokeColor() : ColorInterface|null
- Get the text stroke color
- getTextStream() : Stream|null
- Get text stream
- getWrap() : Wrap|null
- Get text wrap
- hasAlignment() : bool
- Has text alignment
- hasCharWrap() : bool
- Has character wrap
- hasLeading() : bool
- Has character wrap leading
- hasString() : bool
- Has text string
- hasStrings() : bool
- Has text string array
- hasTextStream() : bool
- Has text stream
- hasWrap() : bool
- Has text wrap
- setAlignment() : Text
- Method to set the text alignment
- setCharWrap() : Text
- Method to set the character wrap
- setFillColor() : Text
- Set the text fill color
- setLeading() : Text
- Method to set the character wrap leading
- setRotation() : Text
- Method to set the rotation of the text
- setSize() : Text
- Set the text size
- setString() : Text
- Set the text string
- setStrings() : Text
- Set the text strings
- setStroke() : Text
- Set the text stroke properties
- setStrokeColor() : Text
- Set the text stroke color
- setTextParams() : Text
- Set the text parameters for rendering text content
- setTextStream() : Text
- Method to set the text stream
- setWrap() : Text
- Method to set the text wrap
- startStream() : string
- Start the text stream
- calculateTextMatrix() : string
- Calculate text matrix
Properties
$alignment
Text alignment object
protected
Alignment|null
$alignment
= null
$charWrap
Basic wrap based on character length
protected
int
$charWrap
= 0
$fillColor
Text fill color
protected
ColorInterface|null
$fillColor
= null
$leading
Leading for the lines for a character wrap
protected
int
$leading
= 0
$size
Text font size
protected
int|float
$size
= 12
$stream
Text stream object
protected
Stream|null
$stream
= null
$string
Text string value
protected
string|null
$string
= null
$strings
Text strings as array for streaming
protected
array<string|int, mixed>
$strings
= []
$stringsWithOffsets
Text strings with offset values
protected
array<string|int, mixed>
$stringsWithOffsets
= []
$stroke
Text stroke
protected
array<string|int, mixed>
$stroke
= ['width' => 0, 'dashLength' => null, 'dashGap' => null]
$strokeColor
Text stroke color
protected
ColorInterface|null
$strokeColor
= null
$textParams
Text parameters
protected
array<string|int, mixed>
$textParams
= ['c' => 0, 'w' => 0, 'h' => 100, 'v' => 100, 'rot' => 0, 'rend' => 0]
$wrap
Text wrap object
protected
Wrap|null
$wrap
= null
Methods
__construct()
Constructor
public
__construct([string|null $string = null ][, string|null $size = null ]) : mixed
Instantiate a PDF text object.
Parameters
- $string : string|null = null
- $size : string|null = null
addStringWithOffset()
Add a string with offset
public
addStringWithOffset(string $string[, int $offset = 0 ]) : Text
Parameters
- $string : string
- $offset : int = 0
Return values
TextendStream()
End the text stream
public
endStream() : string
Return values
stringescape()
Escape string
public
escape([mixed $search = null ][, mixed $replace = null ]) : Text
Parameters
- $search : mixed = null
- $replace : mixed = null
Return values
TextgetAlignment()
Get text alignment
public
getAlignment() : Alignment|null
Return values
Alignment|nullgetCharWrap()
Get character wrap
public
getCharWrap() : int
Return values
intgetColorStream()
Get the partial color stream
public
getColorStream() : string
Return values
stringgetFillColor()
Get the text fill color
public
getFillColor() : ColorInterface|null
Return values
ColorInterface|nullgetLeading()
Get character wrap leading
public
getLeading() : int
Return values
intgetNumberOfWrappedLines()
Get number of wrapped lines from character wrap
public
getNumberOfWrappedLines() : int
Return values
intgetPartialStream()
Get the partial text stream
public
getPartialStream([string|null $fontReference = null ]) : string
Parameters
- $fontReference : string|null = null
Return values
stringgetRotation()
Get the rotation of the text
public
getRotation() : int
Return values
intgetSize()
Get the text size
public
getSize() : int|float
Return values
int|floatgetStream()
Get the text stream
public
getStream(string $fontReference, int $x, int $y) : string
Parameters
- $fontReference : string
- $x : int
- $y : int
Return values
stringgetString()
Get the text string
public
getString() : string|null
Return values
string|nullgetStrings()
Get the text string array
public
getStrings() : array<string|int, mixed>
Return values
array<string|int, mixed>getStringsWithOffset()
Get strings with offset
public
getStringsWithOffset() : array<string|int, mixed>
Return values
array<string|int, mixed>getStroke()
Get the text stroke properties
public
getStroke() : array<string|int, mixed>
Return values
array<string|int, mixed>getStrokeColor()
Get the text stroke color
public
getStrokeColor() : ColorInterface|null
Return values
ColorInterface|nullgetTextStream()
Get text stream
public
getTextStream() : Stream|null
Return values
Stream|nullgetWrap()
Get text wrap
public
getWrap() : Wrap|null
Return values
Wrap|nullhasAlignment()
Has text alignment
public
hasAlignment() : bool
Return values
boolhasCharWrap()
Has character wrap
public
hasCharWrap() : bool
Return values
boolhasLeading()
Has character wrap leading
public
hasLeading() : bool
Return values
boolhasString()
Has text string
public
hasString() : bool
Return values
boolhasStrings()
Has text string array
public
hasStrings() : bool
Return values
boolhasTextStream()
Has text stream
public
hasTextStream() : bool
Return values
boolhasWrap()
Has text wrap
public
hasWrap() : bool
Return values
boolsetAlignment()
Method to set the text alignment
public
setAlignment(Alignment $alignment) : Text
Parameters
- $alignment : Alignment
Return values
TextsetCharWrap()
Method to set the character wrap
public
setCharWrap(int $charWrap[, int|null $leading = null ]) : Text
Parameters
- $charWrap : int
- $leading : int|null = null
Return values
TextsetFillColor()
Set the text fill color
public
setFillColor(ColorInterface $color) : Text
Parameters
- $color : ColorInterface
Return values
TextsetLeading()
Method to set the character wrap leading
public
setLeading(int $leading) : Text
Parameters
- $leading : int
Return values
TextsetRotation()
Method to set the rotation of the text
public
setRotation(int $rotation) : Text
Parameters
- $rotation : int
Tags
Return values
TextsetSize()
Set the text size
public
setSize(int|float $size) : Text
Parameters
- $size : int|float
Return values
TextsetString()
Set the text string
public
setString(string $string) : Text
Parameters
- $string : string
Return values
TextsetStrings()
Set the text strings
public
setStrings(array<string|int, mixed> $strings) : Text
Parameters
- $strings : array<string|int, mixed>
Return values
TextsetStroke()
Set the text stroke properties
public
setStroke(int $width[, int|null $dashLength = null ][, int|null $dashGap = null ]) : Text
Parameters
- $width : int
- $dashLength : int|null = null
- $dashGap : int|null = null
Return values
TextsetStrokeColor()
Set the text stroke color
public
setStrokeColor(ColorInterface $color) : Text
Parameters
- $color : ColorInterface
Return values
TextsetTextParams()
Set the text parameters for rendering text content
public
setTextParams([int $c = 0 ][, int $w = 0 ][, int $h = 100 ][, int $v = 100 ][, int $rot = 0 ][, int $rend = 0 ]) : Text
Parameters
- $c : int = 0
-
(character spacing)
- $w : int = 0
-
(word spacing)
- $h : int = 100
-
(horz stretch)
- $v : int = 100
-
(vert stretch)
- $rot : int = 0
-
(rotation, -90 - 90)
- $rend : int = 0
-
(render flag, 0 - 7)
Tags
Return values
TextsetTextStream()
Method to set the text stream
public
setTextStream(Stream $stream) : Text
Parameters
- $stream : Stream
Return values
TextsetWrap()
Method to set the text wrap
public
setWrap(Wrap $wrap) : Text
Parameters
- $wrap : Wrap
Return values
TextstartStream()
Start the text stream
public
startStream(string $fontReference, int $x, int $y) : string
Parameters
- $fontReference : string
- $x : int
- $y : int
Return values
stringcalculateTextMatrix()
Calculate text matrix
protected
calculateTextMatrix() : string