Acrobat SDK Overview |
The Acrobat SDK is a set of tools that help you develop software that interacts with Acrobat technology. The SDK contains header files, type libraries, simple utilities, sample code, and documentation.
Using the Acrobat SDK, you can develop software that integrates with Acrobat and Adobe Reader in several ways:
The Acrobat SDK provides support for development on both Windows and Apple Mac OS environments.
Besides the technologies provided by the Acrobat SDK, you can also use the PDF Library (PDFL) to develop applications that create and manipulate PDF documents but do not interact with Acrobat. For more information, see Adobe PDF Library.
JavaScript
JavaScript is a cross-platform scripting language. Through its JavaScript extensions, Acrobat exposes much of the functionality of Acrobat and its plug-ins to the document author. The JavaScript objects, properties and methods can also be accessed through Visual Basic or C# to automate the processing of PDF documents.
Acrobat defines several objects that allow your code to interact with the Acrobat application, a PDF document, or fields within a PDF document. The most commonly used objects control the Acrobat or Adobe Reader application, the JavaScript console, the PDF document, SOAP web services, databases, security, searches, and JavaScript events.
JavaScript can be applied at a variety of levels. Each of the levels represents a context in which processing occurs, which affects when the scripts are loaded and how they are accessed inside and outside documents.
The placement of a script at a given level also determines its reusability. For example, folder level scripts are available within all documents, document level scripts are available to all fields within a given document, and field level scripts are visible only to the fields with which they are associated.
Plug-ins
Plug-ins are dynamically-linked extensions to Acrobat or Adobe Reader. They can hook in to the user interface in a number of ways and can register to be called when a variety of events occur in the application.
A plug-in is written in ANSI C/C++ and uses the Acrobat public APIs. It can add functionality to Acrobat Pro Extended, Acrobat Professional, Acrobat Standard, or Adobe Reader. A plug-in program file goes into a Plug_ins folder or directory and is initialized during Acrobat or Adobe Reader startup.
There are three types of plug-ins:
On Windows, plug-ins are DLLs. However, plug-in names must end in .API, not .DLL. On Mac OS, plug-ins are code fragments, whereas on UNIX, plug-ins are shared libraries.
Interapplication Communication
Acrobat provides support for interapplication communication (IAC) through OLE automation and DDE on Windows, and through Apple events and AppleScript on Mac OS. Adobe Reader also supports IAC, but does not support OLE on Windows.
IAC support allows programs to control Acrobat or Adobe Reader in much the same way a user would. You can also use IAC support to render a PDF file into an external application window instead of the Acrobat window. The IAC methods and events serve as wrappers for some of the core API calls in the SDK.
On Windows, you can develop IAC applications using Visual Basic .NET, Visual C++ .NET, or Visual C# .NET. On Mac OS, you develop IAC applications using Xcode. CodeWarrior is not supported.
Choosing the correct Acrobat SDK Technology |
As you already know, you can develop software that integrates with Acrobat and Adobe Reader in three ways: JavaScript, Plug-ins, and IAC.
Based on your application's requirements, choose the appropriate technologies for development. In some situations, the desired functionality is only available using one technology. In other situations, you can choose between two or more technologies. For example, you can add menu items to Acrobat using either JavaScript or a plug-in.
You can also use more than one technology in a single application or single document. For example, you can use both plug-ins and JavaScript to implement a particular feature.
Situations where Plug-ins are Better than JavaScript
In general, plug-ins allow for more direct control over Acrobat than JavaScript. There is a richer set of APIs that you can use from a plug-in. For example, the following tasks can only be done using a plug-in; there is no equivalent JavaScript functionality:
Situations where JavaScript is Better than Plug-ins
The following example tasks can be done easily using JavaScript, but have no equivalent plug-in API:
Some of these example tasks, such as SOAP and Web services, can in fact be done with a plug-in by using low-level APIs. However, this is a time-consuming approach and requires an in-depth knowledge of the low-level APIs.
Situations where to Use IAC
To take advantage of Acrobat functionality from within an external application, use IAC.
So, you can use the IAC API to open and view a PDF document. You can also use the IAC API to perform these tasks:
You can also extend the functionality of the IAC interfaces by writing plug-ins that use core API objects not already part of the IAC support system.