
178
17
Working with Cos Objects
A PDF file is structured as a tree of low-level objects, called Cos objects. Cos objects form all PDF document
components, such as bookmarks, pages, fonts, images, and annotations. The Acrobat core API contains
methods (the Cos layer) that enable you to operate directly on these low-level objects. You may encounter
a situation where you want to perform a task that is not supported by using AV and PD layer methods. In
such a situation, it is necessary to use Cos methods.
For example, the
Creating Annotations
chapter explains how to set text annotations properties by using
PDTextAnnot
methods. Some newer types of annotations, such as 3D annotations, have properties that
cannot be accessed directly by PD layer methods. As a result, you must use Cos layer methods to access
the PDF dictionary representing the annotation. For information, see
“Creating 3D Annotations” on
page 203
.
This chapter contains the following information.
Caution:
Care is required when working with Cos objects. Unlike using AV and PD objects, Cos objects can
produce invalid PDF files. Before working with Cos objects, it is strongly recommended that you
be familiar with concepts such as resource dictionaries, that are discussed in the
PDF Reference
.
About Cos objects
PDF files contain various
Cos
object types. In addition to basic data types such as integer, fixed, and
Boolean values,
Cos
objects also contain the following object types:
●
Array
●
Dictionary
●
Name
●
String
●
Stream
Topic
Description
See
About Cos objects
Describes the characteristics of Cos objects.
page 178
Working with Cos strings
Describes how to work with Cos strings.
page 183
Working with Cos arrays
Describes how to work with Cos arrays.
page 184
Working with Cos dictionaries
Working with Cos dictionaries.
page 186
Working with Cos names
Working with Cos names.
page 188
Working with Cos streams
Working with Cos streams
page 190