class HexaPDF::Type::PageLabel

Parent

Represents a page label dictionary.

A page label dictionary contains information about the numbering style, the label prefix and the start number to construct page labels like 'A-1' or 'iii'. What is not stored is the page to which it is applied since that is stored in a number tree referenced through the /PageLabels entry in the document catalog.

See HexaPDF::Document::Pages for details on how to create and manage page labels.

Examples:

  • numbering style :decimal, prefix none, start number default value

    1, 2, 3, 4, …

  • numbering style :lowercase_letters, prefix 'Appendix ', start number 5

    Appendix e, Appendix f, Appendix g, …

  • numbering style :uppercase_roman, prefix none, start number 10

    X, XI, XII, XIII, …

  • numbering style :none, prefix 'Page', start number default value

    Page, Page, Page, Page, …

  • numbering style :none, prefix none, start number default value

    “”, “”, “”, … (i.e. always the empty string)

See: PDF1.7 s12.4.2, HexaPDF::Document::Pages, HexaPDF::Type::Catalog

Field Definitions

NameType/Allowed ValuesRequiredDefault Value
TypeSymbolfalse:PageLabel
SSymbol
One of: :D, :R, :r, :A, :a
falsenil
PStringfalsenil
StIntegerfalse1

Public Instance Methods

construct_label(index)

Constructs the page label for the given index which needs to be relative to the page index of the first page in the associated labelling range.

This method is usually not called directly but through HexaPDF::Document::Pages#page_label.