SetaPDF_Extractor_Sorter_Baseline A sorter class that sorts lines by comparing the baseline of text items.

File: /SetaPDF/Extractor/Sorter/Baseline.php

Class hierarchy

Summary

Properties

$_matrix

A temporary matrix used in the sort process.


Methods

groupByLines()

public array SetaPDF_Extractor_Sorter_Baseline::groupByLines ( SetaPDF_Extractor_TextItem[] $textItems )

Groups all text items by lines.

Parameters
$textItems : SetaPDF_Extractor_TextItem[]

The text items

horizontallyThenVertically()

public int SetaPDF_Extractor_Sorter::horizontallyThenVertically ( SetaPDF_Extractor_TextItem $a, SetaPDF_Extractor_TextItem $b )

A sort callback that sort first horizontally then vertically.

Parameters
$a : SetaPDF_Extractor_TextItem
 
$b : SetaPDF_Extractor_TextItem
 
See

isOnSameLine()

public bool SetaPDF_Extractor_Sorter_Baseline::isOnSameLine ( SetaPDF_Extractor_Result_CompareableInterface $a, SetaPDF_Extractor_Result_CompareableInterface $b [, SetaPDF_Core_Geometry_Matrix $matrix = null ] )

Checks whether two items are on the same line or not.

Parameters
$a : SetaPDF_Extractor_Result_CompareableInterface
 
$b : SetaPDF_Extractor_Result_CompareableInterface
 
$matrix : SetaPDF_Core_Geometry_Matrix
 

itemsJoining()

public bool SetaPDF_Extractor_Sorter::itemsJoining ( SetaPDF_Extractor_Result_CompareableInterface $prevItem, SetaPDF_Extractor_Result_CompareableInterface $item [, float $spaceWidthFactor = 2.0 ] )

Checks if two items joining each other.

Parameters
$prevItem : SetaPDF_Extractor_Result_CompareableInterface

The left item.

$item : SetaPDF_Extractor_Result_CompareableInterface

The right item.

$spaceWidthFactor : float

The space width factor.

verticallyThenHorizontally()

public int SetaPDF_Extractor_Sorter::verticallyThenHorizontally ( SetaPDF_Extractor_TextItem $a, SetaPDF_Extractor_TextItem $b )

A sort callback that sort first vertically then horizontally.

Parameters
$a : SetaPDF_Extractor_TextItem
 
$b : SetaPDF_Extractor_TextItem
 
See