22.03.2015 Views

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Annotations <strong>and</strong> Links 13.9<br />

Modifying the Link Cos Object<br />

Each of the three methods which create an annotation return a CosObj. This<br />

structure is the annotation dictionary, <strong>and</strong> may be modified freely. In practice, it is the<br />

link annotation that will most often be modified.<br />

As created by <strong>DLI</strong>, the link annotation dictionary will contain the following key/value<br />

pairs:<br />

• Type Annot<br />

• SubType Link<br />

• Rect [x, y, x+wide, y+depth]<br />

• Border [v1, v2, v3] (if Border is not NULL)<br />

• Color [r, g, b] (if Color is not NULL)<br />

• Dest [...], where the destination is described in the array<br />

This will create a link whose action is defaulted to “GoTo.”<br />

Although "GoTo" is the normal state for a link within a document, there are 13<br />

possible actions for selecting a link permitted in PDF Specification 1.2, <strong>and</strong> a<br />

fourteenth added in PDF Specification 1.3. More may be added in the future.<br />

In order to modify this link to use one of the other actions, you must replace the Dest<br />

couplet with an A key <strong>and</strong> an action dictionary:<br />

1 The Dest couplet is removed, using<br />

CosDictRemove(Dict, ASAtomFromString (“Dest”));.<br />

2 The action dictionary is created, always as a new, indirect, dictionary structure. It<br />

has a Type of Action, a SubType of the action desired (See PDF Specification,<br />

section 6.8), <strong>and</strong> additional parameters depending on the action selected.<br />

The following is extracted from the full example of creating annotations:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!