Graphics Programs Reference
In-Depth Information
We'll discover what the
m
,
l
and
S
operators do in a moment. The numbers are meas-
urements in
points
—a point (or pt) is 1/72 inch. The result of loading this document
into a PDF viewer (after processing with
pdftk
as per
Chapter 2
) is shown in
Figure 5-1
.
The full manually created file (before processing with
pdftk
) is shown in
Example 5-1
.
We're going to be using variations on this file for the rest of this chapter. For the most
part we'll just change the content stream for each example, but later on we'll need to
add one or more extra resources to the PDF. All of these files are found in the online
resources for this topic.
Example 5-1. Skeleton PDF listing for examples in this chapter
%PDF-1.0
PDF header
1 0 obj
Page tree
<< /Kids [2 0 R]
/Type /Pages
/Count 1
>>
endobj
2 0 obj
Page object
<< /Rotate 0
/Parent 1 0 R
/MediaBox [0 0 792 612]
/Resources 3 0 R
/Type /Page
/Contents [4 0 R]
>>
endobj
3 0 obj
Resources
<< >>
4 0 obj
Page content stream
<< /Length 19 >>
stream
200 150 m 600 450 l S
endstream
endobj
5 0 obj
Document catalog
<< /Pages 1 0 R
/Type /Catalog
>>
endobj xref
Skeleton cross-reference table
0 6
trailer
Trailer dictionary
<< /Root 5 0 R
/Size 6
>>
startxref
0
%%EOF
End-of-file marker
Content streams are almost always compressed, so to inspect the content stream of an
existing document, we can use the
pdftk
decompress
operation. For example, the
command: