Previous Next
302
CHAPTER 4 Graphics
4.6.3 Shading Patterns
Shading patterns (PDF 1.3) provide a smooth transition between colors across an
area to be painted, independent of the resolution of any particular output device
and without specifying the number of steps in the color transition. Patterns of
this type are described by pattern dictionaries with a pattern type of 2. Table 4.26
shows the contents of this type of dictionary.
TABLE 4.26 Entries in a type 2 pattern dictionary
KEY TYPE VALUE
Type name (Optional) The type of PDF object that this dictionary describes; if present,
must be Pattern for a pattern dictionary.
PatternType integer (Required) A code identifying the type of pattern that this dictionary de-
scribes; must be 2 for a shading pattern.
Shading dictionary (Required) A shading object (see below) defining the shading pattern’s gradi-
or stream ent fill. The contents of the dictionary consist of the entries in Table 4.28 and
those in one of Tables 4.29 to 4.34.
Matrix array (Optional) An array of six numbers specifying the pattern matrix (see Section
4.6.1, “General Properties of Patterns”). Default value: the identity matrix
[ 1 0 0 1 0 0 ].
ExtGState dictionary (Optional) A graphics state parameter dictionary (see Section 4.3.4, “Graph-
ics State Parameter Dictionaries”) containing graphics state parameters to be
put into effect temporarily while the shading pattern is painted. Any parame-
ters that are not so specified are inherited from the graphics state that was in
effect at the beginning of the content stream in which the pattern is defined
as a resource.
The most significant entry is Shading, whose value is a shading object defining
the properties of the shading pattern’s gradient fill. This is a complex “paint” that
determines the type of color transition the shading pattern produces when paint-
ed across an area. A shading object may be a dictionary or a stream, depending
on the type of shading; the term shading dictionary is used generically throughout
this section to refer to either a dictionary object or the dictionary portion of a
stream object. (Those shading objects that are streams are specifically identified
as such in the descriptions of particular shading types; unless otherwise stated,
they are understood to be simple dictionaries instead.)
Previous Next