
Adobe Acrobat SDK
Creating Plug-in and PDF Library Applications
Developing Plug-ins and Applications
Updates to ASCoord and AVRect 60
the form
PI_HFT_OPTIONAL
. By default these flags are undefined, so if your plug-in attempts to load
HFT and cannot, initialization will fail. If you define
PI_HFT_OPTIONAL
with some value (preferably 1) and
the load is not successful, initialization will continue.
Use the
ASGetConfiguration
method to determine the configuration on which the plug-in is running.
Use conditional logic in your code so that it makes calls only to APIs that are supported on that particular
configuration. In any case, your code should check for
NULL
HFTs so that it does not call APIs that are not
supported on the current configuration.
Under Adobe Reader, when a rights-enabled PDF file is opened, a flag is set that allows a plug-in to use APIs
that become enabled as a result of loading the rights-enabled PDF. Familiarize yourself with the features
available on the different configurations of Acrobat to ensure that you install plug-in menus and toolbars
appropriately at initialization. Ensure that you make calls only to APIs supported on the platform detected.
Updates to ASCoord and AVRect
The
ASCoord
data type is being deprecated in favor of more descriptive and accurate data types. For new
plug-ins, you should use:
AVDevCoord
: If the coordinate is an AVPageView device coordinate
AVWindowCoord
: If the coordinate is an AVWindow coordinate
AVScreenCoord
: If the coordinate is a screen coordinate, such as AVWindowSetFrame
Though your existing plug-ins will continue to be backward-compatible, you should also change them
accordingly.
If you are currently using
ASCoord
for any coordinates other than those listed above, then you may be
using
ASCoord
inappropriately and it should be changed. You should also replace the
AVRect
datatype
with the more descriptive
AVDevRect
,
AVWindowRect
, and
AVScreenRect
datatypes.
Upgrading plug-ins in Windows
In general, Acrobat 7 and earlier plug-ins require no code modification to make them compatible with
Acrobat 8 running on any Windows platform. The Acrobat 8 SDK is supported on Visual Studio .NET 2003
and Visual Studio .NET 2005, so you must upgrade your plug-ins from previous versions of Visual Studio.
Use Visual Studio .NET 2005 to automatically convert your project from previous versions of Visual Studio.
Once converted, you must also make the following changes to your plug-in’s project:
●
Update the relative path of the header files.
●
Files that are located in the header files folders and are source files of the project need to have their
paths updated. For each plug-in, you need to update the path for PIMain.c. To update these files, delete
the source file from your project and then add it from the correct path.
●
Turn on the GS switch for each plug-in being upgraded. In Visual Studio 2005, click Project > Properties
> C/C++ > Code Generation and set the Buffer Security Check flag to Yes (/GS).
●
Turn on incremental linking for each plug-in being upgraded. In Visual Studio 2005, click Project >
Properties > Linker > General, and set the Enable Incremental Linking flag to Yes.
Once you have upgraded your project to Visual Studio .NET 2005, recompile your plug-in using the
headers provided in the Acrobat 8 SDK. Be sure that the AcroSDKPIDir environment variable is set
correctly. Click My Computer > Control Panel > System > Advanced, set this environment variable to where
you want your compiled plug-ins to appear.