setasign\SetaPDF2\Extractor\Strategy

AbstractStrategy Abstract class representing an extraction strategy.

File: /SetaPDF v2/Extractor/Strategy/AbstractStrategy.php
Old class name (alias): \SetaPDF_Extractor_Strategy_AbstractStrategy

Class hierarchy

Summary

Properties

$_boundaryFilter

$_cleanStreamCallback

A callback that is called before processing a stream.

$_ignoreFaultyStreams

protected bool AbstractStrategy::$_ignoreFaultyStreams = false

Defines wether to continue when a stream cannot be decoded or not.


Methods

__construct()

public AbstractStrategy::__construct (
void
)

The constructor.

_accept()

protected AbstractStrategy::_accept (): bool|string

Proxy method that forwards the call to a filter instance if available.

Parameters
$textItem : \SetaPDF_Extractor_TextItem
 
Exceptions

Throws \setasign\SetaPDF2\Extractor\Exception

Throws \setasign\SetaPDF2\Core\Exception

See

_getSubInstance()

Get an instance of the same strategy for processing another stream (e.g. a Form XObject stream).

Parameters
$gs : \SetaPDF_Core_Canvas_GraphicState
 

getCleanStreamCallback()

public AbstractStrategy::getCleanStreamCallback (
void
): ?callable

Get the callback that is called before a stream is processed.

getFilter()

getResult()

abstract public AbstractStrategy::getResult (
string $stream,
\SetaPDF_Core_Type_Dictionary $resources
): mixed

Get the strategy specific result.

Parameters
$stream : string
 
$resources : \SetaPDF_Core_Type_Dictionary
 

process()

Processes a stream through this strategy.

The result is an array of \setasign\SetaPDF2\Extractor\TextItem instances.

Parameters
$stream : string
 
$resources : \SetaPDF_Core_Type_Dictionary
 

setBoundary()

Sets the boundary for the current strategy.

Parameters
$boundary : ?\SetaPDF_Core_Geometry_Rectangle
 

setCleanStreamCallback()

public AbstractStrategy::setCleanStreamCallback (
?callable $callback = null
): void

Set a callback that is called before processing a stream.

Parameters
$callback : ?callable
 

setFilter()

Set a filter.

Parameters
$filter : ?\SetaPDF_Extractor_Filter_FilterInterface
 

setIgnoreFaultyStreams()

public AbstractStrategy::setIgnoreFaultyStreams (
bool $ignoreFaultyStreams
): void

Define wether to continue when a stream cannot be decoded or not.

Parameters
$ignoreFaultyStreams : bool