Graphics Programs Reference
In-Depth Information
Group
Used for
Operators
Other painting operators
Shading patterns and inline images.
sh BI ID EI Do
Text operators
Select and show text in various fonts and
ways.
Tc Tw Tz TL Tf Tr Ts Td TD
Tm T* Tj TJ ' '' d0 d1
Marked content and compatibility oper-
ators
Used to demarcate sections of the stream.
MP DP BMC BDC EMC BX EX
The page is rendered by considering each operator and its operands in turn. The
graphics state is maintained throughout, altered by some operators, consulted by oth-
ers. Operands are often numbers, but can be names, dictionaries, or arrays.
The part of the graphics state which would be needed to render our examples, as it may
appear in a typical PDF implementation, is summarized in Table 5-2 .
Table 5-2. Graphics state
Entry
Type
Initial value
Current transformation matrix
matrix
The matrix which transforms default user coordinates to device
coordinates
Fill color
color
Black
Line color
color
Black
Line width
real
1.0
Path join style
integer
Mitered joins (0)
Cap style
integer
Square butt caps (0)
Line dash pattern
integer array
Solid line
Current clipping path
path
The empty path
Blend mode
name or array
Normal
Soft mask
name or dictionary
None
Alpha constant
real
1.0 (full opacity)
Alpha source
boolean
false
Building and Painting Paths
We're using a landscape US Letter page (width 11 inches or 792 points; height 8.5
inches or 612 pts). The PDF coordinate system, by default, has the origin at the lower-
left corner of the page, with x and y increasing rightward and upward, respectively.
Let's use some path construction, stroking, and line attribute operators to build a sim-
ple graphics stream:
100 100 m 300 200 l 700 100 l Move to (100, 100), line to (300, 200), line to (700, 100)
S Stroke the line
8 w Change line width from the default (1.0) to 8.0
Search WWH ::




Custom Search