Table of Contents

Class PdfPageLabels

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

Page labels are used to identify each page visually on the screen or in print. @author Paulo Soares (psoares@consiste.pt)

public class PdfPageLabels
Inheritance
PdfPageLabels
Inherited Members

Constructors

PdfPageLabels()

Creates a new PdfPageLabel with a default logical page 1

public PdfPageLabels()

Fields

DECIMAL_ARABIC_NUMERALS

Logical pages will have the form 1,2,3,...

public const int DECIMAL_ARABIC_NUMERALS = 0

Field Value

int

EMPTY

No logical page numbers are generated but fixed text may still exist

public const int EMPTY = 5

Field Value

int

LOWERCASE_LETTERS

Logical 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)

public const int LOWERCASE_LETTERS = 4

Field Value

int

LOWERCASE_ROMAN_NUMERALS

Logical pages will have the form i,ii,iii,iv,...

public const int LOWERCASE_ROMAN_NUMERALS = 2

Field Value

int

UPPERCASE_LETTERS

Logical 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)

public const int UPPERCASE_LETTERS = 3

Field Value

int

UPPERCASE_ROMAN_NUMERALS

Logical pages will have the form I,II,III,IV,...

public const int UPPERCASE_ROMAN_NUMERALS = 1

Field Value

int

Methods

AddPageLabel(int, int)

Adds or replaces a page label. There is no text prefix and the first logical page has the default of 1.

public void AddPageLabel(int page, int numberStyle)

Parameters

page int

the real page to start the numbering. First page is 1

numberStyle int

the numbering style such as LOWERCASE_ROMAN_NUMERALS

AddPageLabel(int, int, string)

Adds or replaces a page label. The first logical page has the default of 1.

public void AddPageLabel(int page, int numberStyle, string text)

Parameters

page int

the real page to start the numbering. First page is 1

numberStyle int

the numbering style such as LOWERCASE_ROMAN_NUMERALS

text string

the text to prefix the number. Can be null or empty

AddPageLabel(int, int, string, int)

Adds or replaces a page label.

public void AddPageLabel(int page, int numberStyle, string text, int firstPage)

Parameters

page int

the real page to start the numbering. First page is 1

numberStyle int

the numbering style such as LOWERCASE_ROMAN_NUMERALS

text string

the text to prefix the number. Can be null or empty

firstPage int

the first logical page number

AddPageLabel(PdfPageLabelFormat)

Adds or replaces a page label.

public void AddPageLabel(PdfPageLabels.PdfPageLabelFormat format)

Parameters

format PdfPageLabels.PdfPageLabelFormat

GetPageLabelFormats(PdfReader)

Retrieves the page labels from a PDF as an array of {@link PdfPageLabelFormat} objects. or null if no page labels are present

public static PdfPageLabels.PdfPageLabelFormat[] GetPageLabelFormats(PdfReader reader)

Parameters

reader PdfReader

a PdfReader object that has the page labels you want to retrieve

Returns

PdfPageLabelFormat[]

a PdfPageLabelEntry array, containing an entry for each format change

GetPageLabels(PdfReader)

Retrieves the page labels from a PDF as an array of String objects.

public static string[] GetPageLabels(PdfReader reader)

Parameters

reader PdfReader

a PdfReader object that has the page labels you want to retrieve

Returns

string[]

a String array or null if no page labels are present

RemovePageLabel(int)

Removes a page label. The first page lagel can not be removed, only changed.

public void RemovePageLabel(int page)

Parameters

page int

the real page to remove