Graphics Programs Reference
In-Depth Information
Figure 4-2. A page tree for seven pages. The exact shape of the tree is left to the individual PDF
application. The PDF code for this tree is shown in Example 4-2 .
Key
Value type
Value
/Rotate
integer
The viewing rotation of the page in degrees, clockwise from north.
Value must be a multiple of 90. Default value: 0. This applies to
both viewing and printing. If this entry is missing, its value is in-
herited from its parent node in the page tree.
/MediaBox *
rectangle
The page's media box (the size of its media, i.e., paper). For most
purposes, the page size. If this entry is missing, it is inherited from
its parent node in the page tree.
/CropBox
rectangle
The page's crop box. This defines the region of the page visible by
default when a page is displayed or printed. If absent, its value is
defined to be the same as the media box.
The rectangle data structure for the media box and the other boxes is an array of four
numbers. These define the diagonally opposite corners of the rectangle—the first two
elements of the array being the x and y coordinates of one corner, the latter two elements
being those of the other. Normally, the lower-left and upper-right corners are given.
So, for example:
/MediaBox [0 0 500 800]
/CropBox [100 100 400 700]
defines a 500 by 800 point page with a crop box removing 100 points on each side of
the page.
The pages are linked together using a page tree , rather than a simple array. This tree
structure makes it faster to find a given page in a document with hundreds or thousands
of pages. Good PDF applications build a balanced tree (one with the minimum height
for the number of nodes). This ensures that a particular page can be located quickly.
The nodes with no children are the pages themselves. An example page tree structure
for seven pages is shown in Figure 4-2 .
This would be written in PDF objects as shown in Example 4-2 . The entries in an
intermediate or root page tree node (i.e., not a page itself) are summarized in Table 4-5 .
 
Search WWH ::




Custom Search