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


Methods

__construct()

__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()

Implementation of the Iterator interface.

See

getBounds()

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

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

getItems()

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()

Implementation of the ArrayAccess interface.

Parameters
$offset : int
 
Exceptions

Throws \InvalidArgumentException

See

offsetSet()

public Words::offsetSet (): void

Implementation of the ArrayAccess interface.

Parameters
$offset : ?int
 
$value : \SetaPDF_Extractor_Result_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()

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