Documentation

Text
in package

Pdf page text class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
4.2.0

Table of Contents

$alignment  : Alignment
Text alignment object
$charWrap  : int
Basic wrap based on character length
$fillColor  : ColorInterface
Text fill color
$leading  : int
Leading for the lines for a character wrap
$size  : int
Text font size
$stream  : Stream
Text stream object
$string  : string
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
Text stroke color
$textParams  : array<string|int, mixed>
Text parameters
$wrap  : Wrap
Text wrap object
__construct()  : mixed
Constructor
addStringWithOffset()  : Text
Add a string with offset
endStream()  : string
End the text stream
escape()  : Text
Escape string
getAlignment()  : Alignment
Get text alignment
getCharWrap()  : int
Get character wrap
getColorStream()  : string
Get the partial color stream
getFillColor()  : ColorInterface
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
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
Get the text stroke color
getTextStream()  : Stream
Get text stream
getWrap()  : Wrap
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 $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 $size = 12

$stream

Text stream object

protected Stream $stream = null

$string

Text string value

protected string $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 $wrap = null

Methods

__construct()

Constructor

public __construct([string $string = null ][, string $size = null ]) : mixed

Instantiate a PDF text object.

Parameters
$string : string = null
$size : string = null
Return values
mixed

addStringWithOffset()

Add a string with offset

public addStringWithOffset(string $string, int $offset) : Text
Parameters
$string : string
$offset : int
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 $fontReference = null ]) : string
Parameters
$fontReference : string = 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
Return values
string

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
Return values
Stream

getWrap()

Get text wrap

public getWrap() : Wrap
Return values
Wrap

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

setAlignment()

Method to set the text alignment

public setAlignment(Alignment $alignment) : Text
Parameters
$alignment : Alignment
Return values
Text

setCharWrap()

Method to set the character wrap

public setCharWrap(int $charWrap[, int $leading = null ]) : Text
Parameters
$charWrap : int
$leading : int = 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 $dashLength = null ][, int $dashGap = null ]) : Text
Parameters
$width : int
$dashLength : int = null
$dashGap : int = null
Return values
Text

setTextParams()

Set the text parameters for rendering text content

public setTextParams(int $c, int $w[, int $h = 100 ][, int $v = 100 ], int $rot, int $rend) : Text
Parameters
$c : int

(character spacing)

$w : int

(word spacing)

$h : int = 100

(horz stretch)

$v : int = 100

(vert stretch)

$rot : int

(rotation, -90 - 90)

$rend : int

(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

Search results