Previous Next


                                            151
     SECTION 3.7                                          Content Streams and Resources



 3.7 Content Streams and Resources

     Content streams are the primary means for describing the appearance of pages
     and other graphical elements. A content stream depends on information
     contained in an associated resource dictionary; in combination, these two objects
     form a self-contained entity. This section describes these objects.


3.7.1 Content Streams

     A content stream is a PDF stream object whose data consists of a sequence of
     instructions describing the graphical elements to be painted on a page. The
     instructions are represented in the form of PDF objects, using the same object
     syntax as in the rest of the PDF document. However, whereas the document as a
     whole is a static, random-access data structure, the objects in the content stream
     are intended to be interpreted and acted upon sequentially.

     Each page of a document is represented by one or more content streams. Content
     streams are also used to package sequences of instructions as self-contained
     graphical elements, such as forms (see Section 4.9, “Form XObjects”), patterns
     (Section 4.6, “Patterns”), certain fonts (Section 5.5.4, “Type 3 Fonts”), and
     annotation appearances (Section 8.4.4, “Appearance Streams”).

     A content stream, after decoding with any specified filters, is interpreted
     according to the PDF syntax rules described in Section 3.1, “Lexical
     Conventions.” It consists of PDF objects denoting operands and operators. The
     operands needed by an operator precede it in the stream. See Example 3.3 on
     page 68 for an example of a content stream.

     An operand is a direct object belonging to any of the basic PDF data types except
     a stream. Dictionaries are permitted as operands only by certain specific
     operators. Indirect objects and object references are not permitted at all.

     An operator is a PDF keyword that specifies some action to be performed, such as
     painting a graphical shape on the page. An operator keyword is distinguished
     from a name object by the absence of an initial slash character (/ ). Operators are
     meaningful only inside a content stream.

     Note: This postfix notation, in which an operator is preceded by its operands, is
     superficially the same as in the PostScript language. However, PDF has no concept
     of an operand stack as PostScript has. In PDF, all of the operands needed by an op-

Previous Next