Graphics Programs Reference
In-Depth Information
/Resources 3 0 R
Object number 3 is associated with the dictionary key /Resources .
/Parent 1 0 R
Object number 1 is associated with the dictionary key /Parent .
/Contents [4 0 R]
The one-element array of indirect references [4 0 R] is associated with the dic-
tionary key /Contents .
Page Content
The page content is a list of operators, each of which is preceded by zero or more
operands. Here's a series of operators for selecting the /F0 font at 36 points and placing
text at the current position:
/F0 36.0 Tf
(Hello, World!) Tj
Here, Tf and Tj are the operators, and /F0 , 36.0 , and (Hello, World!) are the operands.
You can see that some syntactic elements (names and strings, for example) are shared
across the languages used for both page content and document content.
File Structure
The file structure consists of:
• A header to distinguish the file as a PDF document.
• A cross-reference table listing the byte offsets of each object in the document—this
allows the objects to be accessed arbitrarily, rather than having to be read in order.
• The trailer , which includes the byte offset of the cross-reference table, followed by
an end-of-file marker.
When writing our example file, we'll use incomplete values for a lot of the file structure,
relying on pdftk to fill in the details. For example, it's impractical for us to write the
cross-reference table manually.
Document Structure
The example we'll be building is just about the simplest meaningful PDF file. However,
it needs a surprisingly large number of elements. In addition to the file structure we've
described above, a minimal PDF document must have a number of basic sections
present:
• The trailer dictionary , which provides information about how to read the rest of
the objects in the file.
• The document catalog , which is the root of the object graph.
Search WWH ::




Custom Search