Repository navigation
PDF Spec 12 Page Navigation
Part of: PDF-Spec-12-Interactive-Features
Navigation: PDF-Spec-12-Navigation | PDF-Spec-Index | PDF-Spec-12-Annotations
Each page in a PDF document shall be identified by an integer page index that expresses the page's relative position within the document. In addition, a document may optionally define page labels (PDF 1.3) to identify each page visually on the screen or in print. Page labels and page indices need not coincide: the indices shall be fixed, running consecutively through the document starting from 0 for the first page, but the labels may be specified in any way that is appropriate for the particular document.
NOTE 1
If the document begins with 12 pages of front matter numbered in roman numerals and the remainder of the document is numbered in arabic, the first page would have a page index of 0 and a page label of i, the twelfth page would have index 11 and label xii, and the thirteenth page would have index 12 and label 1.
For purposes of page labelling, a document shall be divided into labelling ranges , each of which is a series of consecutive pages using the same numbering system. Pages within a range shall be numbered sequentially in ascending order. A page's label consists of a numeric portion based on its position within its labelling range, optionally preceded by a label prefix denoting the range itself .
NOTE 2 The pages in an appendix might be labeled with decimal numeric portions prefixed with the string A-; the resulting page labels would be A-1, A-2, and so on.
A document's labelling ranges shall be defined by the PageLabels entry in the document catalogue (see 7.7.2, 'Document Catalog'). The value of this entry shall be a number tree (7.9.7, 'Number Trees'), each of whose keys is the page index of the first page in a labelling range. The corresponding value shall be a page label dictionary defining the labelling characteristics for the pages in that range. The tree shall include a value for page index 0. Table 159 shows the contents of a page label dictionary.
Table 159 - Entries in a page label dictionary
| Key | Type | Value |
|---|---|---|
| Type | name | (Optional) The type of PDF object that this dictionary describes; if present, shall be PageLabel for a page label dictionary. |
| S | name | (Optional) The numbering style that shall be used for the numeric portion of each page label: D Decimal arabic numerals R Uppercase roman numerals r Lowercase roman numerals A Uppercase letters (A to Z for the first 26 pages, AA to ZZ for the next 26, and so on) a Lowercase letters (a to z for the first 26 pages, aa to zz for the next 26, and so on) There is no default numbering style; if no S entry is present, page labels shall consist solely of a label prefix with no numeric portion. NOTE If the P entry (next) specifies the label prefix Contents, each page is simply labeled Contents with no page number. (If the P entry is also missing or empty, the page label is an empty string.) |
| P | text string | (Optional) The label prefix for page labels in this range. |
| St | integer | (Optional) The value of the numeric portion for the first page label in the range. Subsequent pages shall be numbered sequentially from this value, which shall be greater than or equal to 1. Default value: 1. |
EXAMPLE
The following example shows a document with pages labeled
i, ii, iii, iv, 1, 2, 3, A-8, A-9, … 1 0 obj << /Type /Catalog /PageLabels << /Nums [ 0 << /S /r >> % A number tree containing 4 << /S /D >> % three page label dictionaries 7 << /S /D /P ( A- ) /St 8 >> ] >> … >> endobj
Some types of documents may contain sequences of content items that are logically connected but not physically sequential.
EXAMPLE 1 A news story may begin on the first page of a newsletter and run over onto one or more nonconsecutive interior pages.
To represent such sequences of physically discontiguous but logically related items, a PDF document may define one or more articles (PDF 1.1) . The sequential flow of an article shall be defined by an article thread ; the individual content items that make up the article are called beads on the thread. Conforming readers may provide navigation facilities to allow the user to follow a thread from one bead to the next.
The optional Threads entry in the document catalogue (see 7.7.2, 'Document Catalog') holds an array of thread dictionaries (Table 160) defining the document's articles. Each individual bead within a thread shall be
represented by a bead dictionary (Table 161). The thread dictionary's F entry shall refer to the first bead in the thread; the beads shall be chained together sequentially in a doubly linked list through their N (next) and V (previous) entries. In addition, for each page on which article beads appear, the page object (see 7.7.3, 'Page Tree') shall contain a B entry whose value is an array of indirect references to the beads on the page, in drawing order.
Table 160 - Entries in a thread dictionary
| Key | Type | Value |
|---|---|---|
| Type | name | (Optional) The type of PDF object that this dictionary describes; if present, shall be Thread for a thread dictionary. |
| F | dictionary | (Required; shall be an indirect reference) The first bead in the thread. |
| I | dictionary | (Optional) A thread information dictionary containing information about the thread, such as its title, author, and creation date. The contents of this dictionary shall conform to the syntax for the document information dictionary (see 14.3.3, 'Document Information Dictionary'). |
Table 161 - Entries in a bead dictionary
| Key | Type | Value |
|---|---|---|
| Type | name | (Optional) The type of PDF object that this dictionary describes; if present, shall be Bead for a bead dictionary. |
| T | dictionary | (Required for the first bead of a thread; optional for all others ; shall be an indirect reference) The thread to which this bead belongs. (PDF 1.1) This entry shall be permitted only for the first bead of a thread. (PDF 1.2) It shall be permitted for any bead but required only for the first. |
| N | dictionary | (Required; shall be an indirect reference) The next bead in the thread. In the last bead, this entry shall refer to the first bead. |
| V | dictionary | (Required; shall be an indirect reference) The previous bead in the thread. In the first bead, this entry shall refer to the last bead. |
| P | dictionary | (Required; shall be an indirect reference) The page object representing the page on which this bead appears. |
| R | rectangle | (Required) A rectangle specifying the location of this bead on the page. |
EXAMPLE 2 The following example shows a thread with three beads.
22 0 obj << /F 23 0 R /I << /Title ( Man Bites Dog ) >> >> endobj 23 0 obj << /T 22 0 R /N 24 0 R /V 25 0 R /P 8 0 R /R [ 158 247 318 905 ] >> endobj 24 0 obj << /T 22 0 R
/N 25 0 R /V 23 0 R /P 8 0 R /R [ 322 246 486 904 ] >> endobj 25 0 obj << /T 22 0 R /N 23 0 R /V 24 0 R /P 10 0 R /R [ 157 254 319 903 ] >> endobj
Some conforming readers may allow a document to be displayed in the form of a presentation or slide show, advancing from one page to the next either automatically or under user control. In addition, PDF 1.5 introduces the ability to advance between different states of the same page (see 12.4.4.2, 'Sub-page Navigation').
NOTE 1 PDF 1.4 introduces a different mechanism, known as alternate presentations, for slide show displays, described in 13.5, 'Alternate Presentations.'
A page object (see 7.7.3, 'Page Tree') may contain two optional entries, Dur and Trans (PDF 1.1) , to specify how to display that page in presentation mode. The Trans entry shall contain a transition dictionary describing the style and duration of the visual transition to use when moving from another page to the given page during a presentation. Table 162 shows the contents of the transition dictionary. (Some of the entries shown are needed only for certain transition styles, as indicated in the table.)
The Dur entry in the page object specifies the page's display duration (also called its advance timing ): the maximum length of time, in seconds, that the page shall be displayed before the presentation automatically advances to the next page.
NOTE 2 The user can advance the page manually before the specified time has expired.
If no Dur entry is specified in the page object, the page shall not advance automatically.
Table 162 - Entries in a transition dictionary
| Key | Type | Value |
|---|---|---|
| Type | name | (Optional) The type of PDF object that this dictionary describes; if present, shall be Trans for a transition dictionary. |
| S | name | (Optional) The transition style that shall be used when moving to this page from another during a presentation. Default value: R. Split Two lines sweep across the screen, revealing the new page. The lines may be either horizontal or vertical and may move inward from the edges of the page or outward from the center, as specified by the Dm and M entries, respectively. Blinds Multiple lines, evenly spaced across the screen, synchronously sweep in the same direction to reveal the new page. The lines may be either horizontal or vertical, as specified by the Dm entry. Horizontal lines move downward; vertical lines move to the right. Box A rectangular box sweeps inward from the edges of the page or outward from the center, as specified by the M entry, revealing the new page. Wipe A single line sweeps across the screen from one edge to the other in the direction specified by the Di entry, revealing the new page. Dissolve The old page dissolves gradually to reveal the new one. Glitter Similar to Dissolve, except that the effect sweeps across the page in a wide band moving from one side of the screen to the other in the direction specified by the Di entry. R The new page simply replaces the old one with no special transition effect; the D entry shall be ignored. Fly (PDF 1.5) Changes are flown out or in (as specified by M ), in the direction specified by Di , to or from a location that is offscreen except when Di is None. |
| D | number | Push (PDF 1.5) The old page slides off the screen while the new page slides in, pushing the old page out in the direction specified by Di . Cover (PDF 1.5) The new page slides on to the screen in the direction specified by Di , covering the old page. Uncover (PDF 1.5) The old page slides off the screen in the direction specified by Di , uncovering the new page in the direction specified by Di . Fade (PDF 1.5) The new page gradually becomes visible through the old one. |
| (Optional) The duration of the transition effect, in seconds. Default value: 1. | ||
| Dm | name | (Optional; Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H Horizontal V Vertical Default value: H. |
| M | name | (Optional; Split , Box and Fly transition styles only) The direction of motion for the specified transition effect: I Inward from the edges of the page O Outward from the center of the page Default value: I. |
Table 162 - Entries in a transition dictionary (continued)
| Key | Type | Value |
|---|---|---|
| Di | number or name | (Optional; Wipe , Glitter , Fly , Cover , Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. (This differs from the page object's Rotate entry, which is measured clockwise from the top.) If the value is a number, it shall be one of: 0 Left to right 90 Bottom to top (Wipe only) 180 Right to left (Wipe only) 270 Top to bottom 315 Top-left to bottom-right (Glitter only) If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0. |
| SS | number | ( Optional; PDF 1.5; Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition Default: 1.0. |
| B | boolean | ( Optional; PDF 1.5; Fly transition style only ) If true , the area that shall be flown in is rectangular and opaque. Default: false . |
NOTE 3 Figure 56 illustrates the relationship between transition duration ( D in the transition dictionary) and display duration ( Dur in the page object). Note that the transition duration specified for a page (page 2 in the figure) governs the transition to that page from another page; the transition from the page is governed by the next page's transition duration.
Figure 56 - Presentation timing
- EXAMPLE The following example shows the presentation parameters for a page to be displayed for 5 seconds. Before the page is displayed, there is a 3.5-second transition in which two vertical lines sweep outward from the center to the edges of the page.
Sub-page navigation (PDF 1.5) provides the ability to navigate not only between pages but also between different states of the same page.
- NOTE 1 A single page in a PDF presentation could have a series of bullet points that could be individually turned on and off. In such an example, the bullets would be represented by optional content (see 8.11.2, 'Optional Content Groups'), and each state of the page would be represented as a navigation node .
- NOTE 2 Conforming readers should save the state of optional content groups when a user enters presentation mode and restore it when presentation mode ends. This ensures, for example, that transient changes to bullets do not affect the printing of the document.
A navigation node dictionary (see Table 163) specifies actions to execute when the user makes a navigation request.
EXAMPLE Pressing an arrow key.
The navigation nodes on a page form a doubly linked list by means of their Next and Prev entries. The primary node on a page shall be determined by the optional PresSteps entry in a page dictionary (see Table 30).
- NOTE 3 A conforming reader should respect navigation nodes only when in presentation mode (see 12.4.4, 'Presentations').
Table 163 - Entries in a navigation node dictionary
| Key | Type | Value |
|---|---|---|
| Type | name (Optional) The type of PDF object that this dictionary describes; shall be NavNode for a navigation node dictionary. | |
| NA dictionary | (Optional) An action (which may be the first in a sequence of actions) | that shall be executed when a user navigates forward. |
| PA | dictionary | (Optional) An action (which may be the first in a sequence of actions) that shall be executed when a user navigates backward. |
| dictionary | (Optional) The next navigation node, if any. | Next |
| dictionary | (Optional) The previous navigation node, if any. | Prev |
| Dur | number | (Optional) The maximum number of seconds before the conforming reader shall automatically advance forward to the next navigation node. If this entry is not specified, no automatic advance shall occur. |
A conforming reader shall maintain a current navigation node. When a user navigates to a page, if the page dictionary has a PresSteps entry, the node specified by that entry shall become the current node. (Otherwise, there is no current node.) If the user requests to navigate forward (such as an arrow key press) and there is a current navigation node, the following shall occur:
- a) The sequence of actions specified by NA (if present) shall be executed.
If NA specifies an action that navigates to another page, the following actions for navigating to another page take place, and Next should not be present.
- b) The node specified by Next (if present) shall become the new current navigation node.
Similarly, if the user requests to navigate backward and there is a current navigation node, the following shall occur:
- a) The sequence of actions specified by PA (if present) shall be executed.
If PA specifies an action that navigates to another page, the following actions for navigating to another page take place, and Prev should not be present.
- b) The node specified by Prev (if present) shall become the new current navigation node.
Transition effects, similar to the page transitions described earlier, may be specified as transition actions that are part of the NA or PA sequence; see 12.6.4.14, 'Transition Actions.'
If the user requests to navigate to another page (regardless of whether there is a current node) and that page's dictionary contains a PresSteps entry, the following shall occur:
- a) The navigation node represented by PresSteps shall become the current node.
- b) If the navigation request was forward, or if the navigation request was for random access (such as by clicking on a link), the actions specified by NA shall be executed and the node specified by Next shall become the new current node, as described previously.
If the navigation request was backward, the actions specified by PA shall be executed and the node specified by Prev shall become the new current node, as described previously.
- c) The conforming reader shall make the new page the current page and shall display it. Any page transitions specified by the Trans entry of the page dictionary shall be performed.
Navigation: PDF-Spec-12-Navigation | PDF-Spec-Index | PDF-Spec-12-Annotations