
Adobe Acrobat SDK
Contents
Developing Plug-ins and Applications
9
17 Working with Cos Objects (Continued)
Working with Cos names........................................................................................................................................................ 188
Creating Cos names ........................................................................................................................................................... 189
Retrieving the value of a name object ........................................................................................................................ 189
Working with Cos streams ..................................................................................................................................................... 190
Creating Cos streams......................................................................................................................................................... 190
Creating a stream dictionary .................................................................................................................................... 190
Inserting a Cos stream into a PDF document ..................................................................................................... 192
Populating a PDF document with a content stream.............................................................................................. 195
18 Creating 3D Annotations ........................................................................................................203
Creating annotations ............................................................................................................................................................... 203
Adding 3D data to an annotation ....................................................................................................................................... 204
Creating the 3D annotation dictionary entries ........................................................................................................ 205
Specifying the 3D stream ................................................................................................................................................. 205
Creating the stream object ....................................................................................................................................... 206
Adding the Cos stream to the annotation dictionary ..................................................................................... 207
Creating the attributes dictionary .......................................................................................................................... 207
Specifying JavaScript code........................................................................................................................................ 208
Setting the default view ................................................................................................................................................... 209
Setting the annotation appearance ............................................................................................................................. 210
Setting the activation dictionary................................................................................................................................... 213
19 Handling Exceptions ...............................................................................................................214
Creating exception handlers................................................................................................................................................. 214
Returning a value from an exception handler ................................................................................................................ 215
Raising exceptions .................................................................................................................................................................... 215
Exception handling scenarios............................................................................................................................................... 215
Using goto statements...................................................................................................................................................... 215
Using nested exception handlers ................................................................................................................................. 216
Using register variables .................................................................................................................................................... 217
20 Working with Acrobat Extended APIs....................................................................................218
About Acrobat extended APIs .............................................................................................................................................. 218
Search extended API ................................................................................................................................................................ 219
Catalog extended API .............................................................................................................................................................. 219
PDF Consultant and Accessibility Checker extended API........................................................................................... 219
How the consultant works............................................................................................................................................... 221
Important issues for consultant development......................................................................................................... 222
Importing the consultant HFTs into a plug-in .......................................................................................................... 223
Creating and destroying consultants .......................................................................................................................... 224
Registering agents with consultants ........................................................................................................................... 225
Starting the consultant ..................................................................................................................................................... 226
Consultant object type identification.......................................................................................................................... 226
Creating an agent class..................................................................................................................................................... 227
Creating agent constructors ........................................................................................................................................... 228
Recognizing objects of interest ..................................................................................................................................... 228
Post processing stage........................................................................................................................................................ 229