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

Style constant

Decimal arabic numerals

STYLE_LOWERCASE_LETTERS

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

Style constant

Lowercase roman numerals

STYLE_UPPERCASE_LETTERS

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

Style constant

Uppercase roman numerals


Properties

$_catalog

$_ranges

Label ranges


Static Methods

integerToLetters()

public static SetaPDF_Core_Document_Catalog_PageLabels::integerToLetters (
int $integer,
bool $uppercase = true
): string

Converts an integer to a letter.

Parameters
$integer : int
 
$uppercase : bool
 

integerToRoman()

public static SetaPDF_Core_Document_Catalog_PageLabels::integerToRoman (
int $integer,
bool $uppercase = true
): string

Converts an integer to roman numerals.

Parameters
$integer : int
 
$uppercase : bool
 

Methods

__construct()

_getRanges()

Get the page label ranges.

Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

_getTree()

Get the tree page labels number tree object.

Parameters
$create : bool
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

addRange()

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

Add a page label range.

Parameters
$startPage : int

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 : int

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

$encoding : string

The input encoding

Exceptions

Throws SetaPDF_Core_DataStructure_Tree_KeyAlreadyExistsException

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

cleanUp()

Release memory / cycled references.

getDocument()

getPageLabelByPageNo()

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

Get the page label by a page number/index.

Parameters
$pageNo : int

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

Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

getRange()

public SetaPDF_Core_Document_Catalog_PageLabels::getRange (
int $startPage,
string $encoding = 'UTF-8'
): ?array

Get a range by starting page number.

Parameters
$startPage : int
 
$encoding : string
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

getRanges()

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

Ger all ranges.

Parameters
$encoding : string
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

removeRange()

public SetaPDF_Core_Document_Catalog_PageLabels::removeRange (
int $startPage
): ?bool

Removes a range by the starting page number.

Parameters
$startPage : int
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception