Learning Centers

Developing with Inter-Application Communication (IAC)

July 01, 2004

Advertisement
Advertisement
 

Editor's Note: This article is part of the Introduction to Acrobat Development Learning Center

What is IAC?

Inter-Application Communication is a system whereby one application can send a message to another, either to exchange information or to make something happen.

In the case of Acrobat, it provides a set of API's that Visual Basic (or any other supported programming language (Delphi, VBA, C++ etc) can utilise to 'remotely' control Acrobat's features.

Generally speaking the exchange of messages is mostly in a one way direction, this can often make it harder to know the progress of a given task or series of tasks.

It is also important to note that any feature that changes a PDF document in the IAC libraries is available only to the full version of Acrobat (v3,v4,v5 and v6).

How does IAC work?

IAC works by creating a connection between (in our case) VB and Acrobat, this connection comes in the form of an object instantiation - this object is of type 'AcroExch'.

Interactions between VB and Acrobat

'AcroExch' or Acrobat Exchange is the previous name for Acrobat (version 3 and below), by creating an object of type 'AcroExch.App' it allows VB to communicate via IAC with Acrobat (the application). Once you have an this object created it allows you to do some of the following:

  • Start/Close Acrobat
  • Show/Hide Acrobat
  • Execute a Menu Item
  • Remove a Menu Item
  • Set Preferences

If the 'AcroExch.App' object allows you to control Acrobat how do we control PDF Documents? There's another object of course: 'AcroExch.AcroAVDoc'. This object represents the view of a PDF document through its window. This object provides methods to load a PDF document into the window.

The next logical step is to create an object to manipulate the actual PDF document - this object is the 'AcroExch.PDDoc'. We don't really create this object in the traditional sense instead we use our view of the document 'AcroExch.AVDoc' to get access to it.

Using the 'AcroExch.PDDoc' object we can access methods that allow you to directly manipulate the PDF document. Methods such as Rotate Pages, Create Pages, Delete Pages and more.

The Bigger Picture

So let's have a look at the other objects. The objects available to the VB/IAC programmer provided by Acrobat breakdown into two broad categories: Acrobat Viewer level or Portable Document layer.

This diagram shows the key objects and their relationship in the hierarchy to each other.

Object hierarchy

The Acrobat API for IAC has been designed in such a way that each object that is created has a reference to the other objects that contain it or that it is a container for. An example of this is AVApp, it has a reference to AVDoc and AVDoc has a reference to PDDoc and AVPageView.

What's Possible?

The documentation for Acrobat's implementation of IAC is contained in the SDK. In fact there are two documents: IAC Reference, which has the methods and properties and the IAC Overview document which explains what objects exist and also how they are connected.

To really get a handle on the kind of things you can do with IAC you need to get a hold of the documentation. It's in there you will find the methods available for each object.

Let's run through a couple of scenarios where you could use VB/IAC. Using IAC and VB you could rotate the pages in a folder full of PDF's or get detailed information (page count, page sizes etc) about PDF's in batch.

Why do we need Plugins?

The downside to VB/IAC is that Acrobat doesn't expose all of Acrobat's functionality to the IAC API's. Instead Acrobat only exposes the more common tasks.

This means that we still need a way to extend and control Acrobat's core functionality and features - without limitations, this is where plugins shine.

Introducing the JSO Bridge

An amazing thing happened in Acrobat 6, the Acrobat team introduced the Javascript Object -> VB/IAC Bridge. This bridge gave Visual Basic programmers with the ability to access almost all of the features and functionality available to Javascript - but from within Visual Basic!

This is alt text For example VB/IAC can't create Bookmarks - but Javascript can, using the JSO bridge it now means we can create bookmarks using the VB toolset simply by passing the commands across the bridge.

Although we still don't have the same level of inner control as plugins do, we have a lot more exposure to the kind of functionality that's needed in the real world.

Get the SDK for the lowdown on the VB/JSO bridge.

Summary

Of all the programming languages I know, Visual Basic is easily my favorite. It's lack of concern for braces, brackets, semi-colons and more constraints makes it the ideal language for quickly developing or even prototyping applications.

Couple this with the API available via IAC from Acrobat and you can very easily and quickly automate difficult or laborious tasks.

Check out our extensive range of free IAC programs and sample code and also the additional articles available through our Developer Learning Center.

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.