Class PdfPageLabels
java.lang.Object
com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfPageLabels
- All Implemented Interfaces:
Comparator
Page labels are used to identify each
page visually on the screen or in print.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intLogical pages will have the form 1,2,3,...static intNo logical page numbers are generated but fixed text may still existstatic intLogical pages will have the form of uppercase letters (a to z for the first 26 pages, aa to zz for the next 26, and so on)static intLogical pages will have the form i,ii,iii,iv,...(package private) TreeMapThe sequence of logical pages.(package private) static PdfName[]Dictionary values to set the logical page stylesstatic intLogical pages will have the form of uppercase letters (A to Z for the first 26 pages, AA to ZZ for the next 26, and so on)static intLogical pages will have the form I,II,III,IV,... -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPageLabel(int page, int numberStyle) Adds or replaces a page label.voidaddPageLabel(int page, int numberStyle, String text) Adds or replaces a page label.voidaddPageLabel(int page, int numberStyle, String text, int firstPage) Adds or replaces a page label.intCompares twoInteger.booleanNot usedGets the page label dictionary to insert into the document.voidremovePageLabel(int page) Removes a page label.Methods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
DECIMAL_ARABIC_NUMERALS
public static int DECIMAL_ARABIC_NUMERALSLogical pages will have the form 1,2,3,... -
UPPERCASE_ROMAN_NUMERALS
public static int UPPERCASE_ROMAN_NUMERALSLogical pages will have the form I,II,III,IV,... -
LOWERCASE_ROMAN_NUMERALS
public static int LOWERCASE_ROMAN_NUMERALSLogical pages will have the form i,ii,iii,iv,... -
UPPERCASE_LETTERS
public static int UPPERCASE_LETTERSLogical pages will have the form of uppercase letters (A to Z for the first 26 pages, AA to ZZ for the next 26, and so on) -
LOWERCASE_LETTERS
public static int LOWERCASE_LETTERSLogical pages will have the form of uppercase letters (a to z for the first 26 pages, aa to zz for the next 26, and so on) -
EMPTY
public static int EMPTYNo logical page numbers are generated but fixed text may still exist -
numberingStyle
Dictionary values to set the logical page styles -
map
TreeMap mapThe sequence of logical pages. Will contain at least a value for page 1
-
-
Constructor Details
-
PdfPageLabels
public PdfPageLabels()Creates a new PdfPageLabel with a default logical page 1
-
-
Method Details
-
compare
Compares twoInteger.- Specified by:
comparein interfaceComparator- Parameters:
obj- the firstIntegerobj1- the secondInteger- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second
-
equals
Not used- Specified by:
equalsin interfaceComparator- Overrides:
equalsin classObject- Parameters:
obj- not used- Returns:
- always
true
-
addPageLabel
Adds or replaces a page label.- Parameters:
page- the real page to start the numbering. First page is 1numberStyle- the numbering style such as LOWERCASE_ROMAN_NUMERALStext- the text to prefix the number. Can benullor emptyfirstPage- the first logical page number
-
addPageLabel
Adds or replaces a page label. The first logical page has the default of 1.- Parameters:
page- the real page to start the numbering. First page is 1numberStyle- the numbering style such as LOWERCASE_ROMAN_NUMERALStext- the text to prefix the number. Can benullor empty
-
addPageLabel
public void addPageLabel(int page, int numberStyle) Adds or replaces a page label. There is no text prefix and the first logical page has the default of 1.- Parameters:
page- the real page to start the numbering. First page is 1numberStyle- the numbering style such as LOWERCASE_ROMAN_NUMERALS
-
removePageLabel
public void removePageLabel(int page) Removes a page label. The first page label can not be removed, only changed.- Parameters:
page- the real page to remove
-
getDictionary
Gets the page label dictionary to insert into the document.- Returns:
- the page label dictionary
-