SetaPDF_Extractor_Sorter The abstract sorter class.

File: /SetaPDF/Extractor/Sorter.php

Class hierarchy

Summary

Properties

$_matrix

A temporary matrix used in the sort process.


Methods

groupByLines()

abstract public array SetaPDF_Extractor_Sorter::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()

abstract public boolean SetaPDF_Extractor_Sorter::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.

This method has to be implemented by the extending classes.

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