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.

Related Products at PDF Store

PDFlib TET

Reliably extract text from any PDF file with this library/component. TET makes available the text co... View full product details
Download free demo

Nitro PDF Professional

Nitro PDF Professional, your PDF creation and editing product. Priced at $99, Nitro PDF Pro is the m... View full product details
Download free demo

XpdfViewer

This ActiveX control (OCX) provides a PDF file viewer component, enabling developers to add PDF view... View full product details
Download free demo

PDF In-Depth Free Product Trials Ubiquitous PDF

Nitro PDF Professional

the perfect PDF product for business and enterprise, combining an extremely competitive price with a...

Download free demo

XpdfViewer

This ActiveX control (OCX) provides a PDF file viewer component, enabling developers to add PDF viewing...

Download free demo

Ubiquitous PDF: Printable PDF 2010 calendars

With the new year just around the next bend, you might be looking to update your calendars. Thanks to Vertex42.com, users can now download and print a free PDF calendar for 2010. The page lets visitors select from a variety of styles and offers both yearly and monthly calendars.

December 10, 2009
Search Planet PDF
more searching options...







Download PDF Creator

Download The Best of Planet PDF volume 2
Planet PDF Newsletter
Most Popluar Articles
Features

Collating PDFs using JavaScript

Despite the numerous benefits, there can be potential issues with the conversion of paper documents into electronic archives. When scanning paper pages into PDF, it's possible to end up with the odd- and even-numbered pages in separate PDF files. It can be very time-consuming to collate them manually, but there is an easier way. Sean Stewart explains.

Featured Product

BCL easyPDF SDK

BCL easyPDF SDK is a set of PDF Programming Libraries designed specifically to help Software Developers / Programmers build and deploy enterprise class PDF applications for corporate wide PDF...

Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools enfocus

QuickPDF: The Unrivaled PDF Developer Toolkit