Previous Next


                                             194
    CHAPTER 4                                                                     Graphics



    • Marked-content operators associate higher-level logical information with ob-
      jects in the content stream. This information does not affect the rendered ap-
      pearance of the content (although it may determine if the content should be
      presented at all; see Section 4.10, “Optional Content”); it is useful to applica-
      tions that use PDF for document interchange. Marked content is described in
      Section 10.5, “Marked Content.”

    This chapter presents general information about device-independent graphics in
    PDF: how a PDF content stream describes the abstract appearance of a page.
    Rendering—the device-dependent part of graphics—is covered in Chapter 6. The
    Bibliography lists a number of books that give details of these computer graphics
    concepts and their implementation.


4.1 Graphics Objects

    As discussed in Section 3.7.1, “Content Streams,” the data in a content stream is
    interpreted as a sequence of operators and their operands, expressed as basic data
    objects according to standard PDF syntax. A content stream can describe the
    appearance of a page, or it can be treated as a graphical element in certain other
    contexts.

    The operands and operators are written sequentially using postfix notation.
    Although this notation resembles the sequential execution model of the Post-
    Script language, a PDF content stream is not a program to be interpreted; rather,
    it is a static description of a sequence of graphics objects. There are specific rules,
    described below, for writing the operands and operators that describe a graphics
    object.

    PDF provides five types of graphics objects:

    • A path object is an arbitrary shape made up of straight lines, rectangles, and
      cubic Bézier curves. A path may intersect itself and may have disconnected
      sections and holes. A path object ends with one or more painting operators that
      specify whether the path is stroked, filled, used as a clipping boundary, or some
      combination of these operations.
    • A text object consists of one or more character strings that identify sequences of
      glyphs to be painted. Like a path, text can be stroked, filled, or used as a clip-
      ping boundary.

Previous Next