linkClick
Event for clicks on hyperlinks.
[event]
linkClick([in] BSTR linkType, [in] BSTR dest, [in] int page)
This event is called when the user clicks on a hyperlink. The event
will be called even if hyperlinks are disabled (see
enableHyperlinks
).
This event can be used to do processing on hyperlinks, for example, to disallow following of certain types of links.
The event receives three arguments:
linkType
: the type of link (see below)dest
: the link destination (depends on the link type - see below)page
: the link destination page number (depends on the link type - see below)
linkType = "goto"
: a link to another page in the same PDF file -dest
is an empty string, andpage
is the destination page numberlinkType = "pdf"
: a link to another PDF file -dest
is the target PDF file name, andpage
is 0linkType = "launch"
: an arbitrary command to be run -dest
is the command, andpage
is 0linkType = "url"
: a URL link -dest
is the URL, andpage
is 0linkType = "named"
: a "named action" link -dest
is the named action (see the PDF spec for details), andpage
is 0linkType = "unknown"
: an unknown link type -dest
is an empty string, andpage
is 0
VB:
Private Sub viewer_linkClick(linkType As String, dest As String, page As Long) _
Handles viewer.linkClick
If linkType = "goto" Then
...
Else
...
End If
End Sub