class HexaPDF:: Type:: PageLabel
Parent | HexaPDF::Dictionary |
---|
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
-
numbering style :none, prefix none, start number default value
“”, “”, “”, … (i.e. always the empty string)
See: PDF2.0 s12.4.2, HexaPDF::Document::Pages
, HexaPDF::Type::Catalog
Field Definitions
Name | Type/Allowed Values | Required | Default Value |
---|---|---|---|
Type | Symbol | false | :PageLabel |
S | Symbol One of: :D, :R, :r, :A, :a | false | nil |
P | String | false | nil |
St | Integer | false | 1 |
Public Instance Methods
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
.
Returns the numbering style if no argument is given. Otherwise sets the numbering style to the given value.
The following numbering styles are available:
- :none
-
No numbering is done; the label only consists of the prefix.
- :decimal
-
Decimal arabic numerals (1, 2, 3, 4, …).
- :uppercase_roman
-
Uppercase roman numerals (I, II, III, IV, …)
- :lowercase_roman
-
Lowercase roman numerals (i, ii, iii, iv, …)
- :uppercase_letters
-
Uppercase letters (A, B, C, D, …)
- :lowercase_letters
-
Lowercase letters (a, b, c, d, …)