Previous Next
291
SECTION 4.6 Patterns
All patterns are treated as colors; a Pattern color space is established with the CS
or cs operator just like other color spaces, and a particular pattern is installed as
the current color with the SCN or scn operator (see Table 4.24 on page 287).
A pattern’s appearance is described with respect to its own internal coordinate
system. Every pattern has a pattern matrix, a transformation matrix that maps the
pattern’s internal coordinate system to the default coordinate system of the pat-
tern’s parent content stream (the content stream in which the pattern is defined as
a resource). The concatenation of the pattern matrix with that of the parent con-
tent stream establishes the pattern coordinate space, within which all graphics ob-
jects in the pattern are interpreted.
For example, if a pattern is used on a page, the pattern appears in the Pattern sub-
dictionary of that page’s resource dictionary, and the pattern matrix maps pattern
space to the default (initial) coordinate space of the page. Changes to the page’s
transformation matrix that occur within the page’s content stream, such as rota-
tion and scaling, have no effect on the pattern; it maintains its original relation-
ship to the page no matter where on the page it is used. Similarly, if a pattern is
used within a form XObject (see Section 4.9, “Form XObjects”), the pattern ma-
trix maps pattern space to the form’s default user space (that is, the form co-
ordinate space at the time the form is painted with the Do operator). A pattern
may be used within another pattern; the inner pattern’s matrix defines its
relationship to the pattern space of the outer pattern.
Note: PostScript allows a pattern to be defined in one context but used in another.
For example, a pattern might be defined on a page (that is, its pattern matrix maps
the pattern coordinate space to the user space of the page) but be used in a form on
that page, so that its relationship to the page is independent of each individual
placement of the form. PDF does not support this feature; in PDF, all patterns are
local to the context in which they are defined.
4.6.2 Tiling Patterns
A tiling pattern consists of a small graphical figure called a pattern cell. Painting
with the pattern replicates the cell at fixed horizontal and vertical intervals to fill
an area. The effect is as if the figure were painted on the surface of a clear glass
tile, identical copies of which were then laid down in an array covering the area
and trimmed to its boundaries. This process is called tiling the area.
Previous Next