Modifying the User Interface
Adding Navigation to PDF Documents
10
Numbering Pages
You may use Acrobat JavaScript to customize the page numbering schemes used
throughout a document. There are three numbering formats:
●
●
●
decimal (often used for normal page ranges)
roman (often used for front matter such as a preface)
alphabetic (often used for back matter such as appendices)
The
doc
object’s
getPageLabel
and
setPageLabels
methods can be used to control
and customize the appearance of numbering schemes within a PDF document.
The
getPageLabel
method accepts the zero-based page index and returns a string
containing the label for a given page.
The
setPageLabels
method accepts two parameters:
nPage
is the zero-based index for
the page to be labeled, and
aLabel
is an array of three values representing the numbering
scheme. If
aLabel
is not supplied, the method removes page numbering for the specified
page and any others up to the next specified label.
The
aLabel
array contains three required values:
●
●
●
cStyle
: the style of page numbering as shown below in
Table 10.14
cPrefox
: the string used to prefix the numeric portion of the page label
nStart
: the ordinal with which to start numbering the pages
Page Numbering Style Values
T
ABLE
10.14
cStyle value
Description
Decimal numbering
Upper case Roman numbering
Lower case Roman numbering
Upper case alphabetic numbering
Lower case alphabetic numbering
D
R
r
A
a
Acrobat JavaScript Scripting Guide
185