Cos Streams; Working With Cos Strings; Creating Cos Strings; Example 17.1 Creating A Cos String - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications

Cos streams

A stream is a sequence of bytes that can be read a portion at a time. For this reason, objects with
potentially large amounts of data, such as images and page descriptions, are represented as streams. A
stream consists of a dictionary followed by zero or more bytes bracketed between the keywords
and
endstream
dictionary
stream
...Zero or more bytes...
endstream
The
stream
and a line feed or just a line feed, and not by a carriage return alone. The sequence of bytes that make up a
stream is located between the
the stream dictionary must be a direct object. For information, see
page
179.
Note:
For more information about streams, see the PDF Reference.

Working with Cos strings

This section discusses ways in which you can work with Cos strings. For information, see
page
179.

Creating Cos strings

You can use the Acrobat core API to create a
string, perform the following tasks:
1. Create a
passing a
2. Create a
passing the following arguments:
A
CosDoc
An
the string is an indirect object. If
direct and indirect objects" on page
A character pointer that specifies the string. Cos strings can contain NULL characters.
The length of the character pointer.
The following code example creates a
myPDDoc
page
83.

Example 17.1 Creating a Cos string

//Create a new Cos string
char* mystr = "New String";
CosDoc cd = PDDocGetCosDoc(myPDDoc);
CosObj strObj = CosNewString(cd, false, mystr, strlen(mystr));
. The following example shows the basic syntax of a stream:
keyword should be followed by an end-of-line marker consisting of either a carriage return
stream
object that represents a PDF file by invoking the
CosDoc
object.
PDDoc
object that is based on a Cos string by invoking the
CosObj
object.
object that specifies whether the
ASBool
is passed to the
PDDocGetCosDoc
and
keywords. Streams must be indirect objects and
endstream
object that is based on a Cos string. To create a Cos
CosObj
object is an indirect or direct object. If
CosObj
, the string is a direct object. For information, see
false
179.
that is based on a Cos string. A
CosObj
method. For information, see
Working with Cos Objects
Working with Cos strings
"About direct and indirect objects" on
"Cos strings" on
method and
PDDocGetCosDoc
method and
CosNewString
object named
PDDoc
"Creating a PDDoc object" on
183
stream
,
true
"About

Advertisement

Table of Contents
loading

Table of Contents