Adobe ACROBAT SDK 8.1 Manual page 199

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications
CosDictPut (FontDictObj, ASAtomFromString ("Subtype"),
CosNewName (cd, false, ASAtomFromString ("Type1")));
CosDictPut (FontDictObj, ASAtomFromString ("Name"),
CosNewName (cd, false, ASAtomFromString ("F0")));
CosDictPut (FontDictObj, ASAtomFromString ("BaseFont"),
CosNewName (cd,false, ASAtomFromString ("Courier")));
CosDictPut (FontDictObj, ASAtomFromString ("Encoding"),
CosNewName (cd,false, ASAtomFromString ("WinAnsiEncoding")));
HANDLER
AVAlertNote("Trying to add key-value pairs to the Font descriptor
dictionary.");
CosObjDestroy (FontDictObj);
return false;
END_HANDLER
DURING
FontDict = CosNewDict (cd, false, 2);
HANDLER
AVAlertNote ("Trying to create page's resource dictionary.");
CosObjDestroy (FontDictObj);
return false;
END_HANDLER
/* Add entries to the page's resource dictionary.
** <<
** /Font << /F0 5 0 R >>
** /ProcSet 6 0 R
** >>
*/
DURING
/* Add /Font key-value pair to resource dictionary */
CosDictPut (FontDict, ASAtomFromString ("F0"), FontDictObj);
CosDictPut (ResDict, ASAtomFromString ("Font"), FontDict);
HANDLER
AVAlertNote ("Trying to add key-value pairs to the page's resource dict.");
CosObjDestroy (FontDictObj);
CosObjDestroy (FontDict);
CosObjDestroy (ResDict);
return false;
END_HANDLER
/* Create the following proc set resource array.
** [
** /PDF /Text
** ]
*/
DURING
procArray = CosNewArray (cd, true, 5);
HANDLER
AVAlertNote ("Trying to create proc set array.");
CosObjDestroy (FontDictObj);
CosObjDestroy (FontDict);
CosObjDestroy (ResDict);
return false;
END_HANDLER
DURING
CosArrayPut (procArray, 0, CosNewName (cd, false, ASAtomFromString ("PDF")));
Populating a PDF document with a content stream
Working with Cos Objects
199

Advertisement

Table of Contents
loading

Table of Contents