Graphics Programs Reference
In-Depth Information
• The
page tree
, which enumerates the pages in the document.
• At least one
page
. Each page must have:
—Its
resources
, which include, for example, fonts.
—Its
page content
, which contains the instructions for drawing text and graphics
on the page.
This arrangement is illustrated in
Figure 2-1
.
Figure 2-1. Object graph for Hello, World! PDF, with object numbers in brackets from
Example 2-1
Building the Elements
We'll type the PDF data into a text file. The line endings chosen by your text editor are
unimportant (<CR> [Unix and Mac OS X] and <CR><LF> [Microsoft Windows] are
both fine). We're going to skip some information (the data that is hard to work out
manually), relying on
pdftk
to fill it in afterward. We will:
• Use an abbreviated header.
• Miss out the length of the page content stream, so we don't have to manually count
the number of bytes.
• Omit almost all of the cross-reference table.
• Use
0
for the byte offset of the cross-reference table, again to avoid having to count
it manually.