About Direct And Indirect Objects; About Cos Object Types; Cos Strings - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications

About direct and indirect objects

You can create Cos objects as either direct or indirect objects; the choice is specified as a parameter to the
method that creates the object. A direct object is placed directly into another object (such as an array or
dictionary). Direct objects cannot be shared between two or more dictionaries or arrays. An indirect object
is labeled so that it can be referenced by other objects multiple times. The following is the syntax of an
indirect object.
<object number> <generation number> obj
<direct object>
endobj
<object number> <generation number>
referencing another indirect object uses the following syntax:
<object number> <generation number> R
This reference is equivalent to the direct object represented by the indirect object.
This example shows indirect object 6, followed by a reference to it in indirect object 7.
6 0 obj
(This is a string)
endobj
7 0 obj
[ 6 0 R ] %An array with one element that is indirect object 6
endobj
If you were to retrieve the zeroth element in the array represented by object 7, you would get the Cos
object that represents this string value:
This is a string
On the other hand, in the following definition of indirect object 8, the elements of the array are all direct
objects (the integer objects, 1, 2, and 3).
8 0 obj
[1 2 3]
endobj

About Cos object types

Two API objects exist in the Cos layer:
CosDoc
CosObj
There are various methods to create the different types of
well as getting and setting their values.

Cos strings

A string object consists of a series of bytes—unsigned integer values in the range 0 to 255. The string
elements are not integer objects, but are stored in a more compact format. String objects can be written in
the following ways:
As a sequence of literal characters enclosed in parentheses
As hexadecimal data enclosed in angle brackets
, which represents an entire PDF file.
, which represents all the individual object types, such as a Cos string, described in this section.
is known as an indirect object identifier. An object
objects mentioned in this section, as
Cos
Working with Cos Objects
About direct and indirect objects
179

Advertisement

Table of Contents
loading

Table of Contents