PDF In-Depth

Plug-in - Developing a plug-in that acts as an Automation Server

February 11, 2000

Advertisement
Advertisement
 

Please note that whilst this sample has been provided with the express permission of Adobe Developer Support it is NOT supported by them.

This is a Win32 project done with VC++ 5.0 that implements an Acrobat plug-in that demonstrates how to turn it into an Automation (formerly known as "OLE Automation") server.

The name of the plug-in is StartAut, because it is based on Starter.c that is part of the AcroSDK. It was done using ATL (the ActiveX Template Library). It does not use MFC. This proof-of-concept plug-in implements a single object, "StartApp", and that object implements a single method, "HelloWorld", which returns a string.

The subfolder "Test" contains a VB5 project that you can use to test the plug-in.

Since what we are doing is adding Automation capabilities to a plug-in, which is not an executable, the way to access it from an Automation controller is by first instantiating Acrobat, i.e. CreateObject("AcroExch.App"), and then you can instantiate the object exposed by the plug-in, in this example CreateObject("StartApp.StartApp"). This is all demonstrated by the VB5 example.

Also, registration is done every time that the plug-in gets loaded by Acrobat, which means that you have to run Acrobat at least once with the Start32.api in the plug_ins folder, before any controller will find it. In your own plug-in, you may choose instead to do the registration from within your installer.

The StartAut project uses PiMain.c, which is assumed to be in the \pisdk\win directory. The project assumes that the rest of the files are located in \Pub\Automate.

You will need to unzip the entire project into an Automate folder, and then unzip each of the embedded zipfiles into the folders StartAut, Test, and Win32. The project file can be found within the Win32 folder.

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.