Working With Cos Streams; Creating Cos Streams; Creating A Stream Dictionary - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications

Working with Cos streams

This section discusses ways in which you can work with Cos streams. For information, see
page
183.
A stream is represented by an
an arbitrary user-written procedure. When writing or extracting data streams, an
converted to a Cos stream.
Note:
Before reading this section, it is strongly recommended that you are familiar with concepts
discussed earlier in this chapter such as Cos arrays and Cos dictionaries.

Creating Cos streams

You can create a data stream in memory and then insert the stream into a PDF document page. The
following diagram shows the result of a data stream that creates a thin black line segment being inserted
into a PDF document.
The following example shows the syntax of a stream that creates a thin line segment:
150 250 m 150 350 l S
In contrast, the following example shows the syntax of a stream that inserts the text
PDF document:
BT /F0 1 Tf 24 0 0 24 36 756 Tm 0 Tr 0 g 0 Tc 0 Tw \(Hello There) Tj ET
Note:
For information about stream syntax, see the PDF Reference.

Creating a stream dictionary

Each Cos stream has a stream dictionary that contains a
used for the stream's data (if the stream has a filter, the
data). A limit of 4096 bytes exists for the
are not discussed in this section. For more information about stream dictionaries, see the PDF Reference.
object definition. A data stream can be a buffer in memory, a file, or
ASStm
entry. A stream dictionary also has optional entries that
Length
entry that indicates how many bytes are
Length
entry is the number of bytes of encoded
Length
Working with Cos Objects
Working with Cos streams
"Cos streams" on
object must be
ASStm
into a
Hello There
190

Advertisement

Table of Contents
loading

Table of Contents