SetaPDF_Extractor_Sorter_FlexLine A sorter class that sorts lines by comparing text items on their baseline and a threshold factor.
File: /SetaPDF v2/Extractor/Sorter/FlexLine.php
This sorter is not able to detect if an item lays on top of another one!
Class hierarchy
Summary
Properties
$_matrix
protected null|SetaPDF_Core_Geometry_Matrix SetaPDF_Extractor_Sorter::$_matrix
A temporary matrix used in the sort process.
Methods
groupByLines()
public SetaPDF_Extractor_Sorter_FlexLine::groupByLines (
SetaPDF_Extractor_TextItem[] $textItems
): arrayGroups all text items by lines.
Parameters
- $textItems : SetaPDF_Extractor_TextItem[]
The text items
Exceptions
Throws SetaPDF_Core_Exception
horizontallyThenVertically()
A sort callback that sort first horizontally then vertically.
Parameters
Exceptions
Throws SetaPDF_Core_Exception
See
isOnSameLine()
public SetaPDF_Extractor_Sorter_FlexLine::isOnSameLine (
SetaPDF_Extractor_TextItem $a, SetaPDF_Extractor_TextItem $b [, SetaPDF_Core_Geometry_Matrix $matrix = null ]
): boolChecks whether two items are on the same line or not.
Parameters
- $a : SetaPDF_Extractor_TextItem
- $b : SetaPDF_Extractor_TextItem
- $matrix : SetaPDF_Core_Geometry_Matrix
Exceptions
Throws SetaPDF_Core_Exception
itemsJoining()
Checks if two items joining each other.
Parameters
- $a : SetaPDF_Extractor_TextItem
Item A.
- $b : SetaPDF_Extractor_TextItem
Item B.
- $spaceWidthFactor : float
The space width factor.
Exceptions
Throws SetaPDF_Core_Exception
verticallyThenHorizontally()
A sort callback that sort first vertically then horizontally.
Parameters
Exceptions
Throws SetaPDF_Core_Exception