setasign\SetaPDF2\Extractor\Result

WordWithGlyphs This class represnts a single word including its glyphs

File: /SetaPDF v2/Extractor/Result/WordWithGlyphs.php
Old class name (alias): \SetaPDF_Extractor_Result_WordWithGlyphs

Class hierarchy

Implements

Summary

Properties

$_bounds

The bounds of this word.

$_delimiterType

The delimiter type of the word.

$_glyphs

The glyphs of this word.

$_parts

protected self[] WordWithGlyphs::$_parts = array()

The initial words that were used to create this word.

$_word

protected array WordWithGlyphs::$_word = array()

The resulting word in a specific encoding.


Static Methods

merge()

public static WordWithGlyphs::merge (
self $a,
self $b,
string $resultingString = null
): self

Merges two WordWithGlyphs instances into a new one.

The words text-content will be $resultingString.

Parameters
$a : self
 
$b : self
 
$resultingString : string

In UTF-8 encoding.

Exceptions

Throws \ReflectionException


Methods

__construct()

public WordWithGlyphs::__construct (
\SetaPDF_Extractor_Result_Glyph[] $glyphs,
int $delimiterType = 0
)

The constructor.

Parameters
$glyphs : \SetaPDF_Extractor_Result_Glyph[]
 
$delimiterType : int
 

__toString()

public WordWithGlyphs::__toString (
void
): string

Implementation of the magic method __toString().

See

cleanUp()

public WordWithGlyphs::cleanUp (
void
): void

Release memory and cycled references

getBounds()

Get the bounds of this word.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getDelimiterType()

public WordWithGlyphs::getDelimiterType (
void
): int

Get the delimiter type.

getFilterId()

public WordWithGlyphs::getFilterId (
void
): ?string

Get the id of the filter instance that accepted this result.

getGlyphs()

Get the glyphs of this word.

getParts()

public WordWithGlyphs::getParts (
void
): self[]

Get all parts of this word.

If the word is not created by several words, this method will return itself.

getString()

public WordWithGlyphs::getString (
string $encoding = 'utf-8'
): string

Get the words string value in a specific encoding.

Parameters
$encoding : string
 

setDelimiterType()

public WordWithGlyphs::setDelimiterType (
int $delimiterType
): void

Set the delimiter type.

Parameters
$delimiterType : int