Adding The Cos Stream To The Annotation Dictionary; Creating The Attributes Dictionary - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications
A
CosObj
A
CosObj
data is encoded before it is written to the file. If encoding parameters are not required, this value is
ignored. For information about encoding filters, see the PDF Reference.
A
CosByteMax
data is read from the source until it reaches the end of the stream.
The
CosNewStream
example creates a Cos stream.
//Create an ASPathName that specifies the location of the.U3D file
//u3dFileName is a character pointer that specifies the path to this file
ASPathName u3DPathName = ASPathFromPlatformPath((void*) u3dFileName);
//Create an ASFile object and populate it
ASFile asFile = NULL;
ASInt32 err = ASFileSysOpenFile(ASGetDefaultFileSys(), u3DPathName,
ASFILE_READ, &asFile);
ASFileSysReleasePath (ASGetDefaultFileSys(), u3DPathName);
if (asFile == NULL)
AVAlertNote("Error opening 3D data file.");
//Read data stream from the file
ASStm fileStm = ASFileStmRdOpen(asFile, 0);
if (fileStm == NULL)
AVAlertNote("Empty 3D data stream.");
//Create a new Cos stream and set it under 3DD key in the annot dictionary
CosObj stm3D = CosNewStream(cosDoc, true, fileStm, 0, false, CosNewNull(),
CosNewNull(), -1);

Adding the Cos stream to the annotation dictionary

After you create a a
method to add the Cos stream as the value of the
CosDictPutKeyString(cosAnnot,// The annotation dictionary
"3DD",
stm3D);

Creating the attributes dictionary

Complete the entries in the 3D stream dictionary. The
dictionary associated with the stream:
CosObj attrObj = CosStreamDict(stm3D);
Next, entries can be added to the dictionary. The
values. Therefore, strings specified in the code must be explicitly converted to names:
//Set the stream's dictionary
CosDictPutKeyString(attrObj, "Subtype", CosNewName(cosDoc, false,
ASAtomFromString("U3D")));
CosDictPutKeyString(attrObj, "Type", CosNewNameFromString(cosDoc, false,
"3D"));
object that represents the stream dictionary. You can invoke the
object that represents the parameters that are used by the encoding filter if the source
object that specifies the amount of data read from the source. If this value is
method returns a
CosObj
object that represents the Cos stream, invoke the
CosObj
object that represents the Cos stream. The following code
entry of the annotation dictionary:
3DD
// The key
// The CosObj object used as the value
CosStreamDict
and
Type
Subtype
Creating 3D Annotations
Specifying the 3D stream
CosNewNull
CosDictPutKeyString
method obtains the Cos
entries both take name objects as
207
method.
,
-1

Advertisement

Table of Contents
loading

Table of Contents