setasign\SetaPDF2\Extractor

TextItem A text item.

File: /SetaPDF v2/Extractor/TextItem.php
Old class name (alias): \SetaPDF_Extractor_TextItem

Class hierarchy

Implements

Summary

Properties

$_baselineEnd

The baseline end vector.

$_baselineStart

The baseline start vector.

$_bounds

The bounds of this text item.

$_characterSpacing

protected float TextItem::$_characterSpacing

The character spacing value.

$_end

The current transformation matrix when the text item ends.

$_filterId

protected ?string TextItem::$_filterId

The filter id which accepted this item.

$_font

The font object used by this text item.

$_fontSize

protected float TextItem::$_fontSize

The font size.

$_no

protected string TextItem::$_no

An item identifier.

$_orientation

protected float TextItem::$_orientation

The orientation of this text item.

$_rawString

protected string TextItem::$_rawString = ''

The raw PDF string.

$_scaling

protected float TextItem::$_scaling

The scaling value.

$_spaceWidth

protected float TextItem::$_spaceWidth

The space width of the font used by this text item.

$_start

The current transformation matrix when the text item starts.

$_string

protected string[] TextItem::$_string = array()

The resulting string in a specific encoding.

$_ul

The upper left point/vector of this text item.

$_wordSpacing

protected float TextItem::$_wordSpacing

The word spacing value.


Methods

__construct()

public TextItem::__construct (
string $rawString,
\SetaPDF_Core_Font $font,
float $fontSize,
float $characterSpacing,
float $wordSpacing,
float $scaling,
\SetaPDF_Core_Geometry_Matrix $start,
\SetaPDF_Core_Geometry_Matrix $end,
string $no
)

The constructor.

Parameters
$rawString : string
 
$font : \SetaPDF_Core_Font
 
$fontSize : float
 
$characterSpacing : float
 
$wordSpacing : float
 
$scaling : float
 
$start : \SetaPDF_Core_Geometry_Matrix
 
$end : \SetaPDF_Core_Geometry_Matrix
 
$no : string
 

cleanUp()

public TextItem::cleanUp (
void
): void

Release memory and cycled references

getBaseLineEnd()

Get the baseline end vector.

getBaseLineStart()

Get the baseline start vector.

getBounds()

Get the bounds of this text item.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getCharacterSpacing()

public TextItem::getCharacterSpacing (
void
): float

Get the character spacing.

The value is from the local graphic state and not a value in the user space.

getEndMatrix()

Get the transformation matrix which was defined after the text item was shown.

getFilterId()

public TextItem::getFilterId (
void
): ?string

Get the filter id by which this item was accepted.

getFont()

Get the text items font object.

getFontSize()

public TextItem::getFontSize (
void
): float

Get the font size of this text item.

The value is from the local graphic state and not a value in the user space.

getLl()

Get the lower left vector.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getLr()

Get lower right vector.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getNo()

public TextItem::getNo (
void
): string

Get the text item identification.

getOrientation()

public TextItem::getOrientation (
void
): float

Get the orientation of the text item.

getRawString()

public TextItem::getRawString (
void
): string

Get the raw string.

getScaling()

public TextItem::getScaling (
void
): float

Get the scaling value.

The value is from the local graphic state and not a value in the user space.

getStartMatrix()

Get the transformation matrix which was defined when the text item started.

getString()

public TextItem::getString (
string $encoding = 'UTF-8'
): string

Get the string in a specific encoding.

Parameters
$encoding : string
 

getUl()

Get the upper left vector.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getUr()

Get the upper right vector.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getUserSpaceSpaceWidth()

public TextItem::getUserSpaceSpaceWidth (
void
): float

Get the width of the space character in user space.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getWordSpacing()

public TextItem::getWordSpacing (
void
): float

Get the word spacing defined in its graphic state.

The value is from the local graphic state and not a value in the user space.

setFilterId()

public TextItem::setFilterId (
string $filterId
): void

Sets the filter id by which this item was accepted.

Parameters
$filterId : string