
Adobe Acrobat SDK
Working with Acrobat Extended APIs
Developing Plug-ins and Applications
Weblink extended API 236
Weblink extended API
A link in a PDF document that references a URL is referred to as a Weblink.
The Acrobat Weblink plug-in exports its own Host Function Table (HFT), whose methods can be used by
other plug-ins. The HFT’s name is defined in the WLHFTNAME macro, and its version number is
WEB_LINK_HFT_LATEST_VERSION
.
To use the Weblink plug-in’s HFT, a plug-in must include the header file WeblinkHFT.h. The plug-in must
also import the HFT using
ASExtensionMgrGetHFT
and assign the HFT returned by this call to a
plug-in-defined global variable named
gWLHFT
. The easiest way to do this is to use the
Init_gWLHFT
macro defined in the header files.
Note:
For information about the APIs included in the Weblink extended API, see the
Acrobat and PDF
Library API Reference
.
Weblink services
The Weblink plug-in provides the following services:
●
Maintenance of links (editing and storage of URLs associated with links, and so on)
●
Manipulation of links (appropriate cursor changes and dynamic display of URL destinations)
●
Selection of the external web browser
●
Manipulation of the Adobe standard web driver
●
Basic progress status services (progress monitor, wait cursor, and so on)
The Weblink plug-in includes a standard driver, known as the Adobe Standard Web Driver. It allows
support for transport mechanisms or web browsers to be added at a later time.
The Standard Web Driver uses DDE messages and Apple events to communicate with a web browser. It
supports a protocol that consists of a suite of verbs—some going to and some coming from—the web
browser. These verb definitions are provided so that web browsers can implement this protocol to be
compatible with the Adobe standard web driver. Each verb is specified in terms of the platform-specific
implementation: DDE for Windows and Apple events for Mac OS. The standard driver’s use of each verb is
also described. Browsers that wish to use their own protocol may do so by writing a custom driver.
The Weblink plug-in communications software in the Weblink driver is independent of the Acrobat
mechanism for handling links (the PDF implementation of URLs). This separation improves portability by
isolating the highly platform-specific interapplication communication messages. Even on a given
platform, there is no standard among web browsers for handling interapplication communication, and the
actual transport mechanism may vary over time. By separating out the transport code, the Weblink plug-in
remains portable across platforms, across different vendors’ implementations of web browsers, and across
different versions of web browsers from the same vendor.
Writing a custom driver
A driver is an Acrobat core plug-in, written like any other plug-in. A driver must register itself with the
Weblink plug-in during the import, replace, and register phases of the plug-in initialization process by
invoking
RegisterWebDriver
. You pass this method a
WebDriverVector
structure containing a
version number and six pointers to functions that your driver provides to handle web-browser-specific
tasks.