LayerAV_Layer
ObjectWeblink

A link in a PDF document that references a URL is referred to as a Weblink.

The Adobe Acrobat Weblink plug-in adds the capability of linking to documents on the World Wide Web. It allows other plug-ins to access its functionality by means of a Host Function Table (HFT) API.

This document describes the Weblink APIs. It also provides information on Adobe's Standard Weblink Driver, which performs low-level, platform-specific functions with a Web browser on behalf of 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.

Weblink services

The Weblink plug-in provides the following services:

Standard Weblink driver

The Weblink plug-in includes a standard driver, known as Adobe's Standard Web Driver. It allows support for transport mechanisms or Web browsers to be added at a later time.

The Standard 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 on Windows and Apple events on 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 vendor's implementations of web browsers, and across different versions of web browsers from the same vendor.

Custom Weblink 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 phase of the plug-in initialization process by calling 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.

A driver is responsible for the following:

In a typical session, the following actions might occur:



Define Summary
 Define
 BeginWebProgress
 EndWebProgress
 GetAppSpecifier
 Init_gWLHFT
 PROGRESS_HAS_CANCEL
Add either a Cancel button or a message directing the user how to abort the operation.
 PROGRESS_HAS_METER
Put a thermometer-style meter in the progress display.
 RegisterWebDriver
 UpdateWebProgress
 WDVCURRENTREV
 WEB_LINK_HFT_LATEST_VERSION
 WebLinkNUMSELECTORS
 WebProgressDidCancel
 WLCreateOrDeleteWebLinks
 WLHFTNAME
 WWWOpenURL
 WWWOpenURLWithParams
Typedef Summary
 Typedef
 WDAppSpecifier (Macintosh)
A data structure that specifies the path name to the web browser.
 WDAppSpecifier (UNIX)
A data structure that specifies the path name to the web browser.
 WDAppSpecifier (Windows)
A data structure that specifies the path name to the web browser.
 WDAppSupportPredicate
Tests whether a driver can support a given web browser application.
 WDBecomeDriverFunction
Called whenever the state of the driver changes from inactive to current, or vice versa.
 WDBringFrontFunction
Called when the user clicks on the Weblink toolbar button to switch to the browser application.
 WDFollowLinkFunction
Follows and retrieves the link specified by a URL from the PDF document specified by theDoc. Weblink supplies the driver a fully resolved the URL. The driver is solely responsible for launching a web browser, if it requires one. If the driver depends on an external web browser, the driver or the web browser is responsible for bringing that browser to the foreground if the link data is not displayed by the Acrobat viewer.
 WDFollowLinkWithParamsFunction
Follows and retrieves the link specified by a URL from the PDF document specified by theDoc, going to a target frame. Weblink supplies the driver a fully resolved the URL. The driver is solely responsible for launching a web browser, if it requires one. If the driver depends on an external web browser, the driver or the web browser is responsible for bringing that browser to the foreground if the link data is not displayed by the Acrobat viewer.
 WDIsDriverBusyFunction
(Optional) Called to determine if the driver is performing a transaction. Weblink uses this to check that the driver is not busy (driver-defined) before allowing a user to change preferences.
 WDOptionsFunction
(Optional) Called when the user clicks the Options button in the Weblink Preferences dialog box. If this function is NULL, the Options button is disabled.
 WebProgressMonitor
A data structure that implements a progress monitor.
 WWWOpenURLParams
Variable Summary
 Variable
 gWLHFT
Structure Summary
 Structure
 WebDriverVector
A data structure containing callbacks that implement a Weblink driver.
 WWWOpenURLParamsRec
A parameter block specifying the target frame of a URL.
Method Summary
 Method
 
WebProgressMonitor BeginWebProgress(char* message, ASUns32 flags, ASInt32 timeoutTime)
Creates a new Weblink progress.
 
Ends Web Progress.
 
WDAppSpecifier GetAppSpecifier(ASBool promptUser)
Get App Specifier.
 
ASBool RegisterWebDriver(const char* driverName, void* driverRock, WebDriverVector* wdVec)
Register Web Driver.
 
ASBool UpdateWebProgress(WebProgressMonitor progMon, char* message, ASInt32 from, ASInt32 to, ASInt32 outOf, ASInt32 timeoutTime)
Updates Web Progress.
 
ASBool WDAppSupportPredicateProc(void* driverRock, WDAppSpecifier timeoutTime)
Callback functions to test a driver. It tests whether a driver can support a given web browser application.
 
ASBool WDBecomeDriverFunctionProc(void* driverRock, ASBool bComing)
Callback functions for driver state changes.
 
void WDBringFrontFunctionProc(void* driverRock)
Callback functions for Weblink toolbar button click.
 
ASBool WDFollowLinkFunctionProc(void* driverRock, AVDoc theDoc, char* cURL, char* cFormData)
Callback functions for to Follow a Link.
 
ASBool WDFollowLinkWithParamsFunctionProc(void* driverRock, AVDoc theDoc, char* cURL, char* cFormData, WWWOpenURLParams params)
Callback functions for to Follow a Link with parameters.
 
ASBool WDIsDriverBusyFunctionProc(void* driverRock)
Callback functions to check driver transaction status (Optional) Called to determine if the driver is performing a transaction or not. Weblink uses this to check that the driver is not busy before allowing a user to change preferences.
 
void WDOptionsFunctionProc(void* driverRock)
Callback functions for a Weblink Options button click.
 
Checks if the Cancel button was clicked.
 
ASInt32 WLCreateOrDeleteWebLinks(ASBool bCreate, PDDoc pdd, ASInt32 nStart, ASInt32 nEnd, ProgressMonitor pm, void* vPMData, CancelProc cp, void* vCPData)
Creates Or Deletes WebLinks
 
ASBool WWWOpenURL(AVDoc avd, const char* cURL, const char* cFormData)
Opens a new URL.
 
ASBool WWWOpenURLWithParams(AVDoc avd, const char* cURL, const char* cFormData, WWWOpenURLParams params)
Opens a new URL With Parameters .
Defines Detail
BeginWebProgress 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define BeginWebProgress ((*((BeginWebProgress_SELPROTO)(gWLHFT[BeginWebProgress_SEL]))))

File: WLHFT.h
Line: 405
EndWebProgress 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define EndWebProgress ((*((EndWebProgress_SELPROTO)(gWLHFT[EndWebProgress_SEL]))))

File: WLHFT.h
Line: 407
GetAppSpecifier 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define GetAppSpecifier ((*((GetAppSpecifier_SELPROTO)(gWLHFT[GetAppSpecifier_SEL]))))

File: WLHFT.h
Line: 408
Init_gWLHFT 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define Init_gWLHFT ASExtensionMgrGetHFT( ASAtomFromString(WLHFTNAME), WEB_LINK_HFT_LATEST_VERSION);

File: WLHFT.h
Line: 397
PROGRESS_HAS_CANCEL 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define PROGRESS_HAS_CANCEL (1L << 1)

Description

Add either a Cancel button or a message directing the user how to abort the operation.


File: WLHFT.h
Line: 67
PROGRESS_HAS_METER 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define PROGRESS_HAS_METER (1L << 0)

Description

Put a thermometer-style meter in the progress display.


File: WLHFT.h
Line: 63
RegisterWebDriver 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define RegisterWebDriver ((*((RegisterWebDriver_SELPROTO)(gWLHFT[RegisterWebDriver_SEL]))))

File: WLHFT.h
Line: 404
UpdateWebProgress 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define UpdateWebProgress ((*((UpdateWebProgress_SELPROTO)(gWLHFT[UpdateWebProgress_SEL]))))

File: WLHFT.h
Line: 406
WDVCURRENTREV 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WDVCURRENTREV (0L)

File: WLHFT.h
Line: 58
WEB_LINK_HFT_LATEST_VERSION 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WEB_LINK_HFT_LATEST_VERSION (2L)

File: WLHFT.h
Line: 372
WebLinkNUMSELECTORS 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WebLinkNUMSELECTORS (WLNUMSELECTORSplusOne - 1)

File: WLHFT.h
Line: 385
WebProgressDidCancel 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WebProgressDidCancel ((*((WebProgressDidCancel_SELPROTO)(gWLHFT[WebProgressDidCancel_SEL]))))

File: WLHFT.h
Line: 409
WLCreateOrDeleteWebLinks 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WLCreateOrDeleteWebLinks ((*((WLCreateOrDeleteWebLinks_SELPROTO)(gWLHFT[WLCreateOrDeleteWebLinks_SEL]))))

File: WLHFT.h
Line: 411
WLHFTNAME 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WLHFTNAME "WebLink"

File: WLHFT.h
Line: 395
WWWOpenURL 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WWWOpenURL ((*((WWWOpenURL_SELPROTO)(gWLHFT[WWWOpenURL_SEL]))))

File: WLHFT.h
Line: 410
WWWOpenURLWithParams 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define WWWOpenURLWithParams ((*((WWWOpenURLWithParams_SELPROTO)(gWLHFT[WWWOpenURLWithParams_SEL]))))

File: WLHFT.h
Line: 412

Typedefs Detail
WDAppSpecifier 
Product availability: Acrobat, Reader
Platform availability: Macintosh

Syntax

typedef FSSpec* WDAppSpecifier;

A data structure that specifies the path name to the web browser.

See Also


File: WLHFT.h
Line: 46
WDAppSpecifier 
Product availability: Acrobat, Reader
Platform availability: UNIX

Syntax

typedef char* WDAppSpecifier;

A data structure that specifies the path name to the web browser.

See Also


File: WLHFT.h
Line: 55
WDAppSpecifier 
Product availability: Acrobat, Reader
Platform availability: Windows

Syntax

typedef char* WDAppSpecifier;

A data structure that specifies the path name to the web browser.

See Also


File: WLHFT.h
Line: 51
WDAppSupportPredicate 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WDAppSupportPredicateProc* WDAppSupportPredicate;

Tests whether a driver can support a given web browser application.


File: WLHFT.h
Line: 222
WDBecomeDriverFunction 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WDBecomeDriverFunctionProc* WDBecomeDriverFunction;

Called whenever the state of the driver changes from inactive to current, or vice versa.


File: WLHFT.h
Line: 313
WDBringFrontFunction 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WDBringFrontFunctionProc* WDBringFrontFunction;

Called when the user clicks on the Weblink toolbar button to switch to the browser application.


File: WLHFT.h
Line: 321
WDFollowLinkFunction 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WDFollowLinkFunctionProc* WDFollowLinkFunction;

Follows and retrieves the link specified by a URL from the PDF document specified by theDoc. Weblink supplies the driver a fully resolved the URL. The driver is solely responsible for launching a web browser, if it requires one. If the driver depends on an external web browser, the driver or the web browser is responsible for bringing that browser to the foreground if the link data is not displayed by the Acrobat viewer.

For relative links, Weblink prepends a base URL if specified; otherwise, it prepends the appropriate portion from the current document's URL to resolve a relative link.

Weblink automatically handles mapped links, that is, links that generate different results based on the location of the mouse within the links. (Such links are specified by checking the Mapped Coordinates Link box in the Edit URL dialog box. These links have the isMap attribute). Weblink appends "?" to the URL, followed by the x- and y-coordinates of the mouse at the time the link was selected, relative to the upper-left corner of the link's rectangle.


File: WLHFT.h
Line: 258
WDFollowLinkWithParamsFunction 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WDFollowLinkWithParamsFunctionProc* WDFollowLinkWithParamsFunction;

Follows and retrieves the link specified by a URL from the PDF document specified by theDoc, going to a target frame. Weblink supplies the driver a fully resolved the URL. The driver is solely responsible for launching a web browser, if it requires one. If the driver depends on an external web browser, the driver or the web browser is responsible for bringing that browser to the foreground if the link data is not displayed by the Acrobat viewer.

For relative links, Weblink prepends a base URL if specified; otherwise, it prepends the appropriate portion from the current document's URL to resolve a relative link.

Weblink automatically handles mapped links, that is, links that generate different results based on the location of the mouse within the links. (Such links are specified by checking the Mapped Coordinates Link box in the Edit URL dialog box. These links have the isMap attribute). Weblink appends "?" to the URL, followed by the x- and y-coordinates of the mouse at the time the link was selected, relative to the upper-left corner of the link's rectangle.


File: WLHFT.h
Line: 296
WDIsDriverBusyFunction 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WDIsDriverBusyFunctionProc* WDIsDriverBusyFunction;

(Optional) Called to determine if the driver is performing a transaction. Weblink uses this to check that the driver is not busy (driver-defined) before allowing a user to change preferences.

The driver should return busy whenever it is not convenient for it to become the current driver as requested by WDBecomeDriverFunction() .


File: WLHFT.h
Line: 343
WDOptionsFunction 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WDOptionsFunctionProc* WDOptionsFunction;

(Optional) Called when the user clicks the Options button in the Weblink Preferences dialog box. If this function is NULL, the Options button is disabled.


File: WLHFT.h
Line: 329
WebProgressMonitor 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef void* WebProgressMonitor;

A data structure that implements a progress monitor.


File: WLHFT.h
Line: 98
WWWOpenURLParams 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef WWWOpenURLParamsRec WWWOpenURLParams;

File: WLHFT.h
Line: 94

Variables Detail
gWLHFT 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

HFT gWLHFT;

File: WLHFT.h
Line: 387

Structure Detail
WebDriverVector
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

struct WebDriverVector {
 ASUns32 WDVRev; 
 
 ASUns32 nReserved; 
 
 WDAppSupportPredicate doYouSupport; 
 
 WDFollowLinkFunction followLink; 
 
 WDBecomeDriverFunction becomeDriver; 
 
 WDBringFrontFunction bringFront; 
 
 WDOptionsFunction options; 
 
 WDIsDriverBusyFunction isDriverBusy; 
 
 WDFollowLinkWithParamsFunction followLinkWithParams; 
}

A data structure containing callbacks that implement a Weblink driver.

See Also


File: WLHFT.h
Line: 348

Elements
WDVRev  

Driver version number.

 
nReserved  

Currently unused.

 
WWWOpenURLParamsRec 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

struct WWWOpenURLParamsRec {
 ASSize_t size; 
 
 const char* cFrame; 
}

A parameter block specifying the target frame of a URL.

See Also


File: WLHFT.h
Line: 74

Elements
size  

Should be initialized to sizeof(WWWOpenURLParamsRec).

 
cFrame  

The name of the frame to open.


Method Detail
BeginWebProgress()
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

WebProgressMonitor BeginWebProgress(char* message, ASUns32 flags, ASInt32 timeoutTime)

Creates a new Weblink progress.

It creates a new Weblink progress monitor to provide feedback during long operations. Current web browsers follow links asynchronously and use BeginWebProgress(), UpdateWebProgress(), and EndWebProgress() to assure a user that a request is making progress.

Parameters

message — 

IN Message text. A NULL-terminated C string that represents a message to display with the progress monitor.

 
flags — 

IN Possible flag options for the progress monitor. There are two flags defined (in WLHft.h):

Flag option

Description

PROGRESS_HAS_METER

Put a thermometer-style meter in the progress display.

PROGRESS_HAS_CANCEL

Add either a Cancel button or a message directing the user how to abort the operation.

 
timeoutTime — 

IN Timeout period. The amount of time in seconds before the progress monitor indicates that progress is not being made.

Returns

Monitor creation status. A non-NULL value if the monitor's creation was successful, NULL otherwise. In the current implementation, there can be at most one progress monitor.


File: WLHFTProcs.h
Line: 74
EndWebProgress() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

void EndWebProgress(WebProgressMonitor progMon)

Ends Web Progress.

Terminates the current progress monitor.

Parameters

progMon — 

IN The current progress monitor.


File: WLHFTProcs.h
Line: 111
GetAppSpecifier() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

WDAppSpecifier GetAppSpecifier(ASBool promptUser)

Get App Specifier.

Obtains a platform-specific structure specifying the application the user has chosen as the web browser.

Parameters

promptUser — 

IN true if there is no current web browser and the user is prompted to choose one, false otherwise.

Returns

A pointer to a platform-specific data structure that specifies the web browser. On the Mac OS, it is a pointer to an FSSpec. On Windows and UNIX platforms, it is a pointer to a string (char*) representing the full path of the executable application.


File: WLHFTProcs.h
Line: 125
RegisterWebDriver() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool RegisterWebDriver(const char* driverName, void* driverRock, WebDriverVector* wdVec)

Register Web Driver.

Registers a driver with the Weblink plug-in. It must be called during the import, replace, and register phase of the plug-in initialization process of any plug-ins that want to use Weblink services.

Parameters

driverName — 

IN The driver's name. It is a NULL-terminated C string shown to the user to identify the current driver. The string is limited to 255 characters and is copied internally.

 
driverRock — 

IN A pointer to a driver-defined data structure. This value is passed to the driver for every driver-supplied function call.

 
wdVec — 

IN A pointer to a data structure of driver-supplied callback functions. It is not copied; therefore, the structure must be either statically or dynamically allocated, rather than automatically allocated as a local variable. It must not be modified, moved, or deallocated until the plug-in terminates within Acrobat.

Returns

Registration status. true if the registration was successful, false otherwise. Failure occurs if there is insufficient memory or the version number in wdVec is incompatible with the Weblink plug-in.


File: WLHFTProcs.h
Line: 51
UpdateWebProgress() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool UpdateWebProgress(WebProgressMonitor progMon, char* message, ASInt32 from, ASInt32 to, ASInt32 outOf, ASInt32 timeoutTime)

Updates Web Progress.

It updates the state of the current progress monitor.

Parameters

progMon — 

IN The current progress monitor returned from BeginWebProgress().

 
message — 

IN Message text. If non-NULL, the text displayed is changed to that represented by message. If message is NULL, the text is not changed.

 
from — 

IN The lower bound of a sub-range between 0 and outOf to highlight: from and to are the lower and upper bounds of a subrange between 0 and outOf to highlight. Typically the lower bound, from, is zero, but a driver may wish to indicate the progress of an operation that has no known magnitude as a priority. It could do so with a chaser light display by cycling the lower bound, from, through the range between 0 and outOf - 1, and defining the upper bound, to, as from + 1.

 
to — 

IN The upper bound of a sub-range between 0 and outOf to highlight.

 
outOf — 

IN If progMon was created with the PROGRESS_HAS_METER flag, the from, to, and outOf arguments are used to change the state of the bar. The range of the meter is defined from 0 to outOf.

 
timeoutTime — 

IN (Optional) The new timeout period in seconds. If it is non-zero, a new timeout is set.

Returns

Update status. true if the update was successful, false if the monitor timed out or the user canceled the operation. The latter case only happens when the progress monitor was created with the PROGRESS_HAS_CANCEL flag in BeginWebProgress().


File: WLHFTProcs.h
Line: 105
WDAppSupportPredicateProc() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WDAppSupportPredicateProc(void* driverRock, WDAppSpecifier timeoutTime)

Callback functions to test a driver. It tests whether a driver can support a given web browser application.

Parameters

driverRock — 

IN A pointer to a driver-defined data structure provided in RegisterWebDriver(). WDAppSpecifier A platform-specific data structure used to identify the web browser application. On Mac OS, it is a pointer to an FSRef(64 bit) or and FSSpec (32 bit).

 
timeoutTime — 

IN data structure. On Windows, it is a pointer to a string (char*) representing the full path of the executable application.

Returns

true if the driver is compatible with the given web browser application, false otherwise.


File: WLHFT.h
Line: 112
WDBecomeDriverFunctionProc() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WDBecomeDriverFunctionProc(void* driverRock, ASBool bComing)

Callback functions for driver state changes.

It is called whenever the state of the driver changes from inactive to current, or vice versa.

Parameters

driverRock — 

IN A pointer to a driver-defined data structure provided in RegisterWebDriver().

 
bComing — 

IN Tells the driver whether it should become current or relinquish control. If it is true, the driver is being requested to become the current Weblink driver, and it should take any action that is appropriate, such as installing IAC message handlers, opening TCP drivers, and so on. If it is false, the driver is being asked to relinquish its status as current driver and should take whatever action is necessary to accomplish this.

Returns

false if the driver fails to change its state to that requested in bComing, true otherwise.


File: WLHFT.h
Line: 180
WDBringFrontFunctionProc() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

void WDBringFrontFunctionProc(void* driverRock)

Callback functions for Weblink toolbar button click.

It is called when the user clicks on the Weblink toolbar button to switch to the browser application.

Parameters

driverRock — 

IN A pointer to a driver-defined data structure provided in RegisterWebDriver().


File: WLHFT.h
Line: 188
WDFollowLinkFunctionProc() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WDFollowLinkFunctionProc(void* driverRock, AVDoc theDoc, char* cURL, char* cFormData)

Callback functions for to Follow a Link.

Follows and retrieves the link specified by cURL from the PDF document specified by theDoc. Weblink supplies the driver a fully resolved URL. The driver is solely responsible for launching a web browser, if it requires one. If the driver depends on an external web browser, the driver or the web browser is responsible for bringing that browser to the foreground if the link data is not displayed by the Acrobat viewer. For relative links, Weblink prepends a base URL if specified; otherwise, it prepends the appropriate portion from the current document's URL to resolve a relative link. Weblink automatically handles mapped links, which are links that generate different results based on the location of the mouse within the links. (Such links are specified by checking the Mapped Coordinates Link box in the Edit URL dialog box. These links have the isMap attribute). Weblink appends "?" to the URL, followed by the x- and y-coordinates of the mouse at the time the link was selected, relative to the upper-left corner of the link's rectangle.

Parameters

driverRock — 

IN A pointer to a driver-defined data structure provided in RegisterWebDriver().

 
theDoc — 

IN The PDF document that contains the link.

 
cURL — 

IN A NULL-terminated C string containing the URL the link points to.

 
cFormData — 

IN Data from a form to be sent with the URL as post data. The default MIME type of form data is "application/x-www-formunencoded".

Returns

true if the driver has successfully begun the process of following the link, false otherwise.


File: WLHFT.h
Line: 137
WDFollowLinkWithParamsFunctionProc() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WDFollowLinkWithParamsFunctionProc(void* driverRock, AVDoc theDoc, char* cURL, char* cFormData, WWWOpenURLParams params)

Callback functions for to Follow a Link with parameters.

Follows and retrieves the link specified by cURL from the PDF document specified by theDoc. Weblink supplies the driver a fully resolved URL. The driver is solely responsible for launching a web browser, if it requires one. If the driver depends on an external web browser, the driver or the web browser is responsible for bringing that browser to the foreground if the link data is not displayed by the Acrobat viewer. For relative links, Weblink prepends a base URL if specified; otherwise, it prepends the appropriate portion from the current document's URL to resolve a relative link. Weblink automatically handles mapped links, which are links that generate different results based on the location of the mouse within the links. (Such links are specified by checking the Mapped Coordinates Link box in the Edit URL dialog box. These links have the isMap attribute). Weblink appends "?" to the URL, followed by the x- and y-coordinates of the mouse at the time the link was selected, relative to the upper-left corner of the link's rectangle.

Parameters

driverRock — 

IN A pointer to a driver-defined data structure provided in RegisterWebDriver().

 
theDoc — 

IN The PDF document that contains the link.

 
cURL — 

A NULL-terminated C string containing the URL the link points to.

 
cFormData — 

Data from a form to be sent with the URL as post data. The default MIME type of form data is "application/x-www-formunencoded".

 
params — 

IN A parameter block specifying a target frame.

Returns

true if the driver has successfully begun the process of following the link, false otherwise.


File: WLHFT.h
Line: 164
WDIsDriverBusyFunctionProc() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WDIsDriverBusyFunctionProc(void* driverRock)

Callback functions to check driver transaction status (Optional) Called to determine if the driver is performing a transaction or not. Weblink uses this to check that the driver is not busy before allowing a user to change preferences.

Parameters

driverRock — 

IN A pointer to a driver-defined data structure provided in RegisterWebDriver().

Returns

true if the driver is busy (driver-defined), false otherwise. The driver should return busy whenever it is not convenient for it to become the current driver as requested by <DXRef>WDBecomeDriverFunction.


File: WLHFT.h
Line: 207
WDOptionsFunctionProc() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

void WDOptionsFunctionProc(void* driverRock)

Callback functions for a Weblink Options button click.

It is called when the user clicks on the Options button in the Weblink Preferences dialog box. If this function is NULL, the Options button is disabled. Optional: set it to NULL if there no options dialog.

Parameters

driverRock — 

IN A pointer to a driver-defined data structure provided in RegisterWebDriver().


File: WLHFT.h
Line: 197
WebProgressDidCancel() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WebProgressDidCancel(WebProgressMonitor progMon)

Checks if the Cancel button was clicked.

It tests whether the user clicked the Cancel button in the progress monitor dialog.

Parameters

progMon — 

IN The current progress monitor.

Returns

true if the progress monitor has been canceled, false otherwise.


File: WLHFTProcs.h
Line: 133
WLCreateOrDeleteWebLinks() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASInt32 WLCreateOrDeleteWebLinks(ASBool bCreate, PDDoc pdd, ASInt32 nStart, ASInt32 nEnd, ProgressMonitor pm, void* vPMData, CancelProc cp, void* vCPData)

Creates Or Deletes WebLinks

Used by other plug-ins that want to create or delete weblinks in a document.

Adobe Reader does not, by default, create or delete items in a PDF document.

Parameters

bCreate — 

IN A boolean to indicate whether links should be created. If it is false, links will be deleted.

 
pdd — 

IN The PDDoc in which to create or delete weblinks.

 
nStart — 

IN The starting page

 
nEnd — 

IN The ending page

 
pm — 

IN The current progress monitor.

 
vPMData — 

IN The data to be passed to the progress monitor.

 
cp — 

IN The cancel proc

 
vCPData — 

IN The data to be passed to the cancel proc.

Returns

The number of web links created or deleted.


File: WLHFTProcs.h
Line: 161
WWWOpenURL() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WWWOpenURL(AVDoc avd, const char* cURL, const char* cFormData)

Opens a new URL.

Asks Weblink to follow the specified URL. If the URL specifies a PDF document, it opens it in a new window (an AVDoc view). It is used by other plug-ins that wish to start a download.

Parameters

avd — 

IN If specified, it is the AVDoc that contains the source of the URL.

 
cURL — 

IN The URL to be opened.

 
cFormData — 

IN The data for a form to be posted.

Returns

true if the request succeeded, false otherwise.


File: WLHFTProcs.h
Line: 144
WWWOpenURLWithParams() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool WWWOpenURLWithParams(AVDoc avd, const char* cURL, const char* cFormData, WWWOpenURLParams params)

Opens a new URL With Parameters .

Asks Weblink to follow a URL, specifying a target frame. If the URL specifies a PDF document, it opens it in a new window (an AVDoc view). It is used by other plug-ins that wish to start a download and specify a target frame.

Parameters

avd — 

If specified, it is the AVDoc that contains the source of the URL.

 
cURL — 

The URL to be opened.

 
cFormData — 

The data for a form to be posted.

 
params — 

The parameter block specifying the name of the frame.

Returns

true if the request succeeded, false otherwise.


File: WLHFTProcs.h
Line: 174