Creating Cos Names; Retrieving The Value Of A Name Object; Example 17.8 Creating A Cos Name; Example 17.9 Retrieving The Value Of A Name Object - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications

Creating Cos names

You can use the Acrobat core API to create a
name, perform the following tasks:
1. Create a
passing a
2. Create a
the following arguments:
A
CosDoc
An
the string is an indirect object. If
direct and indirect objects" on page
An
The
CosNewName
The following code example creates a Cos name with the value
is passed to the

Example 17.8 Creating a Cos name

//Create a Cos name
CosObj nameObj;
CosDoc cd = PDDocGetCosDoc(myPDDoc);
nameObj = CosNewName(cd, false, ASAtomFromString("Name1"));

Retrieving the value of a name object

You can retrieve the value of a name object by using the Acrobat core API. For example, assume that you
retrieve the value from the Cos name object created in the previous code example. In this situation, the
value that is retrieved is
1. Invoke the
returns an
2. Invoke the
name value. Pass the
The following code example retrieves the value of a name object.

Example 17.9 Retrieving the value of a name object

//Create a Cos name
CosObj nameObj;
CosDoc cd = PDDocGetCosDoc(myPDDoc);
nameObj = CosNewName (cd, false, ASAtomFromString ("Name1"));
//Get and display the value of a Cos name object
ASAtom nameVal = CosNameValue(nameObj);
const char * str = ASAtomGetString(nameVal);
AVAlertNote(str);
Note:
The return value of the
pointer. You will generate a compile error if you omit the
object that represents a PDF file by invoking the
CosDoc
object.
PDDoc
object that represents the name by invoking the
CosObj
object.
object that specifies whether the
ASBool
object that represent the name to create.
ASAtom
method returns a
PDDocGetCosDoc
. To retrieve the value from a Cos name object, perform the following tasks:
Name1
method and pass the
CosNameValue
object that represents the name value.
ASAtom
ASAtomGetString
ASAtom
ASAtomGetString
object that is based on a Cos name. To create a Cos
CosObj
CosObj
, the string is a direct object. For information, see
false
179.
object that represents the new Cos name.
CosObj
method. For information, see
CosObj
method to get a constant character pointer that specifies the Cos
object that is returned from the
method is a constant character pointer, not a character
Working with Cos Objects
Creating Cos names
PDDocGetCosDoc
method and passing
CosNewName
object is an indirect or direct object. If
. A
object named
Name1
PDDoc
"Creating a PDDoc object" on page
that represents the Cos name. This method
method.
CosNameValue
keyword.
const
189
method and
,
true
"About
myPDDoc
83.

Advertisement

Table of Contents
loading

Table of Contents