setasign\SetaPDF2\Extractor\Result

Words This class represents words

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

Class hierarchy

Implements

Summary

Properties

$_items

protected WordInterface[] Words::$_items = array()

Methods

__construct()

public Collection::__construct (
HasBoundsInterface[] $items = array ( )
)

The constructor.

Parameters
$items : HasBoundsInterface[]
 

__toString()

public Words::__toString (
void
): string

Reconstruct the plain text of all words in that collection.

cleanUp()

public Collection::cleanUp (
void
): void

Release memory and cycled references

count()

public Collection::count (
void
): int

Implementation of the Countable interface.

See

current()

public Words::current (
void
): ?WordInterface

Implementation of the Iterator interface.

See

getBounds()

public Collection::getBounds (
void
): Bounds[]

Get the outer-most bounds of all items in this collection.

This method will only return values of non-rotated items.

getItems()

public Words::getItems (
void
): WordInterface[]

Get all items.

getString()

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

Get the words string value in a specific encoding.

Parameters
$encoding : string
 

getStringAndOffsets()

public Words::getStringAndOffsets (
string $encoding = 'utf-8'
): array{string: string, offsets: array<int>}

Get the words string value including offset positions of the words.

Parameters
$encoding : string
 
Return Values

Offsets are only returned if $encoding is set to UTF-8.

key()

public Collection::key (
void
): int

Implementation of the Iterator interface.

See

next()

public Collection::next (
void
): void

Implementation of the Iterator interface.

See

offsetExists()

public Collection::offsetExists (
int $offset
): bool

Implementation of the ArrayAccess interface.

Parameters
$offset : int
 
See

offsetGet()

public Words::offsetGet (
int $offset
): WordInterface

Implementation of the ArrayAccess interface.

Parameters
$offset : int
 
Exceptions

Throws \InvalidArgumentException

See

offsetSet()

public Words::offsetSet (
?int $offset,
WordInterface $value
): void

Implementation of the ArrayAccess interface.

Parameters
$offset : ?int
 
$value : WordInterface
 
Exceptions

Throws \InvalidArgumentException

See

offsetUnset()

public Collection::offsetUnset (
int $offset
): void

Implementation of the ArrayAccess interface.

Parameters
$offset : int
 
See

rewind()

public Collection::rewind (
void
): void

Implementation of the Iterator interface.

See

search()

public Words::search (
string $regex
): Collection

Searches by a regular expression on the string version of the words.

Parameters
$regex : string
 
Return Values

The collection will hold Words instances.

See

valid()

public Collection::valid (
void
): bool

Implementation of the Iterator interface.

See