DynaPDF Manual - Page 61

Previous Page 60   Index   Next Page 62

Actions
Page 61 of 839
Actions
Annotations, form fields, bookmarks (also known as outline items), pages, and the global
Catalog object may specify an action to perform, such as opening another PDF file, jumping to
page, or playing a sound, for example.
Annotations (especially link annotations) and bookmarks can dirctly be associated with an
action. This action will be executed when the object is activated.
Annotations, the catalog object, pages, and form fields support also additional actions which
extend the set of events which trigger the execution of an action.
Actions are usually executed in viewer applications only. Otherwise it would be very difficult to
understand what happens behind the scenes when editing an object.
Actions can be accessed with the following functions:
GetObjActions() / GetObjEvent()
GetGoToAction()
GetGoToRAction()
GetHideAction()
GetImportDataAction()
GetJavaScriptActionEx()
GetLaunchAction()
GetMovieAction()
GetNamedAction()
GetURIAction()
GetObjActions() returns the first action of an object and a pointer to the first trigger event if any.
Actions and trigger events are stored as a single linked list. That means, every action and every
trigger event can reference another action or event that should be executed.
The actions which must be executed for an object should be copied to an execution list and not
directly be executed. This makes sure that a duplicate check can be applied so that no endless
loop occurs when an action references itself.
The first object that should be examined is the catalog object right after a PDF file was opened
with OpenImportFile() or OpenImportBuffer() and after the global objects were imported with
ImportCatalogObjects().
Now render the first page and add the actions of the page to the event list of this page. After
this the actions of form fields should be examined because form fields support events which
must be handled when a page was opened, when it become visible or invisible and when it will
be closed.
 

Previous topic: Field Names, Fields with identical names

Next topic: Digital Signatures, Supported Certificate Formats, External Signatures