setasign\SetaPDF2\Extractor\Filter

FontSizeFilter A font size filter.

File: /SetaPDF v2/Extractor/Filter/FontSizeFilter.php
Old class name (alias): \SetaPDF_Extractor_Filter_FontSize

This filter allows you to text in view to its font size.

Class hierarchy

Implements

Summary

Constants

MODE_BETWEEN

public const string FontSizeFilter::MODE_BETWEEN = '><'

A mode constant.

Defines that the font size needs to be between the given filter values. If this mode is used the filter value needs to be an array. Otherwise the mode will be the same as FontSizeFilter::MODE_EQUALS

MODE_BETWEEN_OR_EQUALS

public const string FontSizeFilter::MODE_BETWEEN_OR_EQUALS = '<=||>='

A mode constant.

Defines that the font size needs to be between or equal to the given filter values. If this mode is used the filter value needs to be an array. Otherwise the mode will be the same as FontSizeFilter::MODE_EQUALS

MODE_EQUALS

public const string FontSizeFilter::MODE_EQUALS = '=='

A mode constant.

Defines that the font size needs to be equal to the given filter value.

MODE_LARGER

public const string FontSizeFilter::MODE_LARGER = '>'

A mode constant.

Defines that the font size needs to be larger than the given filter value.

MODE_LARGER_OR_EQUALS

public const string FontSizeFilter::MODE_LARGER_OR_EQUALS = '>='

A mode constant.

Defines that the font size needs to be larger or equal than the given filter value.

MODE_SMALLER

public const string FontSizeFilter::MODE_SMALLER = '<'

A mode constant.

Defines that the font size needs to be smaller than the given filter value.

MODE_SMALLER_OR_EQUALS

public const string FontSizeFilter::MODE_SMALLER_OR_EQUALS = '<='

A mode constant.

Defines that the font size needs to be smaller or equal than the given filter value.


Properties

$_fontSize

protected null|int|float|int[]|float[] FontSizeFilter::$_fontSize

The font size data to filter by.

$_id

protected ?string FontSizeFilter::$_id

The id of this filter.

$_mode

protected string FontSizeFilter::$_mode = '=='

The mode to work with.


Methods

__construct()

public FontSizeFilter::__construct (
float|float[] $fontSize,
string $mode = FontSizeFilter::MODE_EQUALS,
?string $id = null
)

The constructor.

This filter can work in different modes which are specified through class constants:

  1. MODE_EQUALS: The font size equals the filter value.
  2. MODE_BETWEEN: The font size is between 2 given filter values (pass an array as $fontSize)
  3. MODE_SMALLER: The font size is smaller than the filter value.
  4. MODE_LARGER: The font size is larger than the filter value.
Parameters
$fontSize : float|float[]
 
$mode : string
 
$id : ?string
 

accept()

public FontSizeFilter::accept (): bool|string

Method that is called to decide if a text item accepted or not.

Parameters
$textItem : \SetaPDF_Extractor_TextItem
 
See

getFontSize()

public FontSizeFilter::getFontSize (
void
): array|float|null|number|number[]

Get the font size data.

getId()

public FontSizeFilter::getId (
void
): ?string

Get the filter id.

getMode()

public FontSizeFilter::getMode (
void
): string

Get the mode.