SetaPDF_Core_Document_Catalog_PageLabels Class for handling page labels

File: /SetaPDF v2/Core/Document/Catalog/PageLabels.php

Class hierarchy

Summary

Constants

STYLE_DECIMAL_NUMERALS

const string SetaPDF_Core_Document_Catalog_PageLabels::STYLE_DECIMAL_NUMERALS = 'D'

Style constant

Decimal arabic numerals

STYLE_LOWERCASE_LETTERS

const string SetaPDF_Core_Document_Catalog_PageLabels::STYLE_LOWERCASE_LETTERS = 'a'

Style constant

Lowercase letters (a to z for the first 26 pages, aa to zz for the next 26, and so on)

STYLE_LOWERCASE_ROMAN_NUMERALS

const string SetaPDF_Core_Document_Catalog_PageLabels::STYLE_LOWERCASE_ROMAN_NUMERALS = 'r'

Style constant

Lowercase roman numerals

STYLE_UPPERCASE_LETTERS

const string SetaPDF_Core_Document_Catalog_PageLabels::STYLE_UPPERCASE_LETTERS = 'A'

Style constant

Uppercase letters (A to Z for the first 26 pages, AA to ZZ for the next 26, and so on)

STYLE_UPPERCASE_ROMAN_NUMERALS

const string SetaPDF_Core_Document_Catalog_PageLabels::STYLE_UPPERCASE_ROMAN_NUMERALS = 'R'

Style constant

Uppercase roman numerals


Properties

$_catalog

protected SetaPDF_Core_Document_Catalog SetaPDF_Core_Document_Catalog_PageLabels::$_catalog

The documents catalog instance

$_ranges

protected array SetaPDF_Core_Document_Catalog_PageLabels::$_ranges = array()

Label ranges

$_tree

protected SetaPDF_Core_DataStructure_NumberTree SetaPDF_Core_Document_Catalog_PageLabels::$_tree

The number tree


Static Methods

integerToLetters()

public static SetaPDF_Core_Document_Catalog_PageLabels::integerToLetters (
integer $integer [, boolean $uppercase = true ]
): string

Converts an integer to a letter.

Parameters
$integer : integer
 
$uppercase : boolean
 

integerToRoman()

public static SetaPDF_Core_Document_Catalog_PageLabels::integerToRoman (
integer $integer [, boolean $uppercase = true ]
): string

Converts an integer to roman numerals.

Parameters
$integer : integer
 
$uppercase : boolean
 

Methods

__construct()

_getRanges()

Get the page label ranges.

_getTree()

Get the tree page labels number tree object.

Parameters
$create : boolean
 

addRange()

public SetaPDF_Core_Document_Catalog_PageLabels::addRange (
integer $startPage [, string $style = null [, string $prefix = '' [, integer $firstPageValue = 1 [, string $encoding = 'UTF-8' ]]]]
): void

Add a page label range.

Parameters
$startPage : integer

The page index to start the page label range

$style : string

The page label style. See SetaPDF_Core_Document_Catalog_PageLabels::STYLE_XXX constants

$prefix : string

A page label prefix

$firstPageValue : integer

The value of the numeric portion for the first page in the range

$encoding : string

The input encoding

Exceptions

Throws InvalidArgumentException

cleanUp()

Release memory / cycled references.

getDocument()

getPageLabelByPageNo()

public SetaPDF_Core_Document_Catalog_PageLabels::getPageLabelByPageNo (
integer $pageNo [, string $encoding = 'UTF-8' ]
): string

Get the page label by a page number/index.

Parameters
$pageNo : integer

The page number/index to get the page label for

$encoding : string

The output encoding

Return Values

Returns the page label for the specific page number/index

getRange()

public SetaPDF_Core_Document_Catalog_PageLabels::getRange (
integer $startPage [, string $encoding = 'UTF-8' ]
): array|null

Get a range by starting page number.

Parameters
$startPage : integer
 
$encoding : string
 

getRanges()

public SetaPDF_Core_Document_Catalog_PageLabels::getRanges (
[ string $encoding = 'UTF-8' ]
): array

Ger all ranges.

Parameters
$encoding : string
 

removeRange()

public SetaPDF_Core_Document_Catalog_PageLabels::removeRange (
integer $startPage
): null|boolean

Removes a range by the starting page number.

Parameters
$startPage : integer
 
Exceptions

Throws InvalidArgumentException