Previous Next


                                              153
      SECTION 3.7                                           Content Streams and Resources



3.7.2 Resource Dictionaries

      As stated above, the operands supplied to operators in a content stream may only
      be direct objects; indirect objects and object references are not permitted. In
      some cases, an operator needs to refer to a PDF object that is defined outside the
      content stream, such as a font dictionary or a stream containing image data. This
      can be accomplished by defining such objects as named resources and referring to
      them by name from within the content stream.

      Note: Named resources are meaningful only in the context of a content stream. The
      scope of a resource name is local to a particular content stream and is unrelated to
      externally known identifiers for objects such as fonts. References from one object to
      another outside of content streams should be made by means of indirect object refer-
      ences rather than named resources.

      A content stream’s named resources are defined by a resource dictionary, which
      enumerates the named resources needed by the operators in the content stream
      and the names by which they can be referred to. For example, if a text operator
      appearing within the content stream needs a certain font, the content stream’s
      resource dictionary can associate the name F42 with the corresponding font
      dictionary. The text operator can use this name to refer to the font.

      A resource dictionary is associated with a content stream in one of the following
      ways:

      • For a content stream that is the value of a page’s     Contents entry (or is an
        element of an array that is the value of that entry), the resource dictionary is
        designated by the page dictionary’s Resources entry. (Since a page’s Resources
        attribute is inheritable, as described under “Inheritance of Page Attributes” on
        page 149, it may actually reside in some ancestor node of the page object.)
      • For other content streams, the stream dictionary’s Resources entry specifies the
        resource dictionary. This applies to content streams that define form XObjects,
        patterns, Type 3 fonts, and annotation appearances.
      • A form XObject or a Type 3 font’s glyph description may omit the Resources
        entry, in which case resources are looked up in the Resources entry of the page
        on which the form or font is used. This practice is not recommended.

Previous Next