Documentation

Text
in package

Pdf page text class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.2.0

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

$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]

$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
Text

endStream()

End the text stream

public endStream() : string
Return values
string

escape()

Escape string

public escape([mixed $search = null ][, mixed $replace = null ]) : Text
Parameters
$search : mixed = null
$replace : mixed = null
Return values
Text

getCharWrap()

Get character wrap

public getCharWrap() : int
Return values
int

getColorStream()

Get the partial color stream

public getColorStream() : string
Return values
string

getLeading()

Get character wrap leading

public getLeading() : int
Return values
int

getNumberOfWrappedLines()

Get number of wrapped lines from character wrap

public getNumberOfWrappedLines() : int
Return values
int

getPartialStream()

Get the partial text stream

public getPartialStream([string|null $fontReference = null ]) : string
Parameters
$fontReference : string|null = null
Return values
string

getRotation()

Get the rotation of the text

public getRotation() : int
Return values
int

getSize()

Get the text size

public getSize() : int|float
Return values
int|float

getStream()

Get the text stream

public getStream(string $fontReference, int $x, int $y) : string
Parameters
$fontReference : string
$x : int
$y : int
Return values
string

getString()

Get the text string

public getString() : string|null
Return values
string|null

getStrings()

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>

getTextStream()

Get text stream

public getTextStream() : Stream|null
Return values
Stream|null

getWrap()

Get text wrap

public getWrap() : Wrap|null
Return values
Wrap|null

hasAlignment()

Has text alignment

public hasAlignment() : bool
Return values
bool

hasCharWrap()

Has character wrap

public hasCharWrap() : bool
Return values
bool

hasLeading()

Has character wrap leading

public hasLeading() : bool
Return values
bool

hasString()

Has text string

public hasString() : bool
Return values
bool

hasStrings()

Has text string array

public hasStrings() : bool
Return values
bool

hasTextStream()

Has text stream

public hasTextStream() : bool
Return values
bool

hasWrap()

Has text wrap

public hasWrap() : bool
Return values
bool

setCharWrap()

Method to set the character wrap

public setCharWrap(int $charWrap[, int|null $leading = null ]) : Text
Parameters
$charWrap : int
$leading : int|null = null
Return values
Text

setLeading()

Method to set the character wrap leading

public setLeading(int $leading) : Text
Parameters
$leading : int
Return values
Text

setRotation()

Method to set the rotation of the text

public setRotation(int $rotation) : Text
Parameters
$rotation : int
Tags
throws
OutOfRangeException
Return values
Text

setSize()

Set the text size

public setSize(int|float $size) : Text
Parameters
$size : int|float
Return values
Text

setString()

Set the text string

public setString(string $string) : Text
Parameters
$string : string
Return values
Text

setStrings()

Set the text strings

public setStrings(array<string|int, mixed> $strings) : Text
Parameters
$strings : array<string|int, mixed>
Return values
Text

setStroke()

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
Text

setTextParams()

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
throws
OutOfRangeException
Return values
Text

setTextStream()

Method to set the text stream

public setTextStream(Stream $stream) : Text
Parameters
$stream : Stream
Return values
Text

setWrap()

Method to set the text wrap

public setWrap(Wrap $wrap) : Text
Parameters
$wrap : Wrap
Return values
Text

startStream()

Start the text stream

public startStream(string $fontReference, int $x, int $y) : string
Parameters
$fontReference : string
$x : int
$y : int
Return values
string

calculateTextMatrix()

Calculate text matrix

protected calculateTextMatrix() : string
Return values
string

        
On this page

Search results