Graphics Programs Reference
In-Depth Information
Graphs
The collection of objects in a PDF file form a graph . This meaning of the word graph
is nothing to do with pie charts or histograms, but refers to a collection of nodes con-
nected together by links .
In our case, the nodes are PDF objects, and the links are indirect references. Reading a
PDF document is the process of creating a graph of the PDF objects in the file. This
graph is directed —links only go one way.
Figure 3-1 shows the object graph for the helloworld.pdf document in Example 3-1 .
Figure 3-1. The graph of objects in our example file
We now take a closer look at each of these four parts in turn, using Example 3-1 for
reference.
Header
The first line of a PDF file gives the version number of the document. In our example,
this is:
%PDF-1.0
This defines the file as PDF version 1.0. PDF is backward compatible, so a PDF 1.3
document should be readable by a program which knows about, for example, PDF 1.5.
It is also, for the most part, forward compatible, so most PDF programs will attempt
to read any file, no matter what the supposed version number is.
Since PDF files almost always contain binary data, they can become corrupted if line
endings are changed (for example, if the file is transferred over FTP in text mode). To
 
Search WWH ::




Custom Search