Você está na página 1de 32

bc

Acrobat Developer FAQ


Technical Note #5148 Version : Acrobat 5.0

ADOBE SYSTEMS INCORPORATED

Corporate Headquarters 345 Park Avenue San Jose, CA 95110-2704 (408) 536-6000 http://partners.adobe.com

December, 2001

Copyright 2001 Adobe Systems Incorporated. All rights reserved. NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of the Adobe Systems Incorporated. PostScript is a registered trademark of Adobe Systems Incorporated. All instances of the name PostScript in the text are references to the PostScript language as dened by Adobe Systems Incorporated unless otherwise stated. The name PostScript also is used as a product trademark for Adobe Systems implementation of the PostScript language interpreter. Except as otherwise stated, any reference to a PostScript printing device, PostScript display device, or similar item refers to a printing device, display device or item (respectively) that contains PostScript technology created or licensed by Adobe Systems Incorporated and not to devices or items that purport to be merely compatible with the PostScript language. Adobe, the Adobe logo, Acrobat, the Acrobat logo, Acrobat Capture, Acrobat Catalog, Acrobat Reader, Acrobat Search, Distiller, PostScript, and the PostScript logo are trademarks of Adobe Systems Incorporated. Apple, Macintosh, and Power Macintosh are trademarks of Apple Computer, Inc., registered in the United States and other countries. PowerPC is a registered trademark of IBM Corporation in the United States. ActiveX, Microsoft, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. UNIX is a registered trademark of The Open Group. All other trademarks are the property of their respective owners. This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, tness for particular purposes, and noninfringement of third party rights.

Acrobat SDK Documentation Roadmap


Getting Started Acrobat SDK Release Notes Getting Started Using the Adobe Acrobat Software Development Kit Acrobat Plug-In Tutorial Guide to SDK Samples

Acrobat Development Overview

Acrobat Developer FAQ

Acrobat Core API Acrobat Core API Overview Acrobat Core API Reference

Extended API for Plug-ins Acrobat Catalog API Reference Acrobat Digital Signature API Reference Acrobat Digital Signature API Overview Acrobat Forms API Reference Acrobat Search API Reference Acrobat Spelling API Reference Acrobat Weblink API Reference PDF Consultant (Scrubber)

PDF Creation APIs Acrobat Distiller Parameters Acrobat Distiller API Reference pdfmark Reference Acrobat PDF Writer API Reference

File Format Specications Highlight File Format PDF Reference Manual PDF: Changes From Version 1.3 to 1.4

Acrobat Interapplication Communication (IAC) Acrobat IAC Overview Acrobat IAC Reference Programming Acrobat JavaScript Using Visual Basic

Using ADM in Acrobat

Adobe Dialog Manager Reference

Contents

Acrobat Developer FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . 7


What is New In the Acrobat 5.0 SDK? . Transparency . . . . . . . . . . . Security Handling . . . . . . . . . Batch Processing . . . . . . . . . File Conversion To And From PDF. Cross-platform Dialog Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 .7 .7 .7 .7 .8

Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 JavaScript Access Through OLE Automation . . . . . . . . . . . . . . . . . . . . . . . 8 Basic Acrobat SDK Questions . . . . . . . . . . . . . . . . . . . . What Is Acrobat? . . . . . . . . . . . . . . . . . . . . . . . . What Is the Acrobat SDK? . . . . . . . . . . . . . . . . . . . . What Do I Need to Download from the Web to Get the SDK?. . What Is a Plug-in? . . . . . . . . . . . . . . . . . . . . . . . . What Are Some Common Applications of the Acrobat SDK? . . Where Do I Start with the Acrobat SDK? . . . . . . . . . . . . Where Can I Find Guidelines On Developing Reader Plug-ins? How Is the API Organized? . . . . . . . . . . . . . . . . . . . What Are the Requirements For Using Acrobat Forms? . . . . What is the FDF Toolkit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 .8 .9 .9 10 10 11 11 12 13 13

Licensing and Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 What Should I Know About Acrobat Licensing and Distribution? . . . . . . . . . . . . 13 What Are the Licensing Restrictions and Requirements For Developing Acrobat Reader Plug-ins? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 What Is and Is Not Supported in the Acrobat SDK . . . . . . . . . . . . . What Development Environments are Supported By the Acrobat SDK? What Uses Are Not Supported By the Acrobat SDK? . . . . . . . . . . What ActiveX Solutions Are Provided By the Acrobat SDK? . . . . . . Does the Acrobat SDK Support Multithreading? . . . . . . . . . . . . User and Developer Resources . . . . . . . . . . . . . . . . Where Can I Get Help With Acrobat Product Issues? . . . How Can I Contact Adobe For Technical Support Issues? What Is the ASN Developer Program and How Do I Join? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 15 16 18 18 18 18 19 19

What Adobe Resources Are Recommended to Acrobat Developers?. . . . . . . . . . 21 What Developer Resources Are Provided by Outside Companies? . . . . . . . . . . . 21

Acrobat Developer FAQ

Contents

Acrobat and Acrobat Reader Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . 21 What Are the API Differences Between Acrobat and Acrobat Reader? . . . . . . . . . 21 What Are the Technical Limitations of Using the Interapplication Communication (IAC) API With Acrobat Reader? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How Can I Use Visual Basic with the Acrobat SDK? . . . . . . . . . . . . . . . . . . What Are the Best Resources For Getting Started Using Visual Basic With the Acrobat SDK?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How Can I Use Visual Basic and the Registry To Launch Acrobat or Acrobat Reader?. 22 22 22 23

Enterprise Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 How Can I Customize the Acrobat Installer? . . . . . . . . . . . . . . . . . . . . . . 25 PDF Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 What Options Do I Have To Generate PDF?. . . . . . . . . . . . . . . . . . . . . . . 25 Generating PDF Files without Using Adobe Products . . . . . . . . . . . . . . . . . . 27 What API Methods Are Available to Modify PDF Documents? . . . . . . . . . . . . . 27 What Options Do I Have to Modify PDF Documents Without C Programming Background? 28 How Can I Extract Text From PDF Documents Using the Acrobat SDK? . . . . . . . . 28 How Can I Display a PDF File in an External Application Window? . . . . . . . . . . . 28 Are Multibyte PDF Documents Supported by the Acrobat SDK? . . . . . . . . . . . . 29 How Is Security Provided in PDF Documents? . . . . . . . . . . . . . . . . . . . . . 29 Full-Text Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What Tools Are Available with Acrobat For Full-Text Search? . . . . . What Tools Are Available for Extracting and Highlighting Text? . . . . What Types of Search Plug-ins are Available for the Acrobat Viewer? How Do I Communicate with the Acrobat Search Plug-in? . . . . . . How Do I Create Custom Doc Info Fields For Searching?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 30 30 30 31 31

Miscellaneous Technical Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 How Do I Use Command Lines with Acrobat and Acrobat Reader on Windows? . . . . 32

Acrobat Developer FAQ

Acrobat Developer FAQ

What is New In the Acrobat 5.0 SDK?


This section describes new Acrobat 5.0 features that you can implement in plug-ins you develop, and lists sample programs that illustrate each. See the Guide to SDK Samples for descriptions of all the SDK sample programs. Many new Acrobat core API methods support the new features and extend existing methods and structures. For details on all the new interface changes in the Acrobat 5.0 SDK, see API Changes in the Acrobat Core API Reference.

Transparency
New core API methods allow you to set the degree of opacity of objects in PDF les. See the Transparency and WaterMark samples.

Security Handling
Document security can be set at a ner granularity than in earlier Acrobat versions. Different sets of permissions are available for individual le objects (pages, bookmarks, and so forth). See the SecurityHandler sample. New functionality is available in the SDK for plug-in clients to query permission settings on document objects and for security handlers to support these settings.

Batch Processing
New batch processing core API callback methods are available to the batch framework. The BatchCommand sample illustrates how to implement two batch processing commands. New Acrobat Viewer (AV) layer core API methods are available to batch clients for invoking AV commands programmatically. See the InvokeCommand sample.

File Conversion To And From PDF


Files can be converted from PDF to other le formats and vice versa. See the FileConversion sample, which demonstrates conversion from proprietary le formats to PDF.

Acrobat Developer FAQ

Acrobat Developer FAQ


Basic Acrobat SDK Questions

Cross-platform Dialog Creation


You can use the Adobe Dialog Manager (ADM) to create cross-platform dialogs for Windows and Macintosh. Many of the sample programs use ADM. For more information, see the documents, Using ADM in Acrobat and Adobe Dialog Manager Reference.

Metadata
You can store additional information about objects using XMP, a new standardized metadata format. See the DocMetadata and PageMetadata samples.

JavaScript Access Through OLE Automation


You can access Acrobats JavaScript object model through the OLE Automation interface. See the JSObjectAccess sample. For more information, see Programming Acrobat JavaScript Using Visual Basic.

Basic Acrobat SDK Questions


What Is Acrobat?
Adobe Acrobat 5.0 consists of a suite of applications and utilities for creating, modifying, indexing, searching, displaying, and manipulating PDF (Portable Document Format) les. For further information about the Acrobat product, see the Acrobat Main Page. Viewer Applications

Acrobat Reader for viewing, navigating, and printing PDF documents. Acrobat for adding navigational links, annotations, and security options, in addition to the functionality provided by Acrobat Reader.

Tools For Creating PDF Files for creating PDF les from PostScript les from your favorite Acrobat Distiller applications (including desktop publishing software).

Acrobat PDFWriter for creating PDF les from your favorite business applications using only the Print command.

Other Applications Acrobat Capture with OCR (Optical Character Recognition) for creating textsearchable PDF documents from scanned paper originals.

Acrobat Developer FAQ

Acrobat Developer FAQ


Basic Acrobat SDK Questions

What Is the Acrobat SDK?


The Acrobat Software Development Kit (SDK) is a toolbox that contains samples (example source code), header les (to compile the samples), type libraries, simple utilities, and documentation. These tools help you design and develop:

Acrobat plug-ins that extend the functionality of Acrobat and Acrobat Reader (the Acrobat viewer products). External applications that communicate with and control Acrobat. Where Can I Get the Acrobat SDK?

The Acrobat SDK is available on the Adobe Public Web Site. The Acrobat SDK also is included on a CD with membership to the Adobe Solutions Network (ASN) Developer Program. We encourage you to join the ASN Developer Program to receive developer technical support, marketing assistance, and other benets. To access the Acrobat SDK, see the Acrobat SDK Main Page. For more information on the ASN Developer Program and how to join, see the ASN Developer Program Home Page.

What Do I Need to Download from the Web to Get the SDK?


The SDK is made up of many different technical documents and samples for different operating systems. You will have to determine what it is you want to do and then determine if there is a sample that gets you pointed in the right direction. You can download the installer from the Web site to obtain the entire Acrobat SDK, or you can download each technical note separately. The sample les and documentation are what comprise the Acrobat SDK.
NOTE:

In the Acrobat SDK documents, references that appear online (in blue, italics) are live links. However, to activate these links, you must install the documents on your local le system in the same directory structure in which they appear in the Acrobat SDK. This happens automatically when you install the SDK. If you download individual documents and want the links to work, you must install the documents in the appropriate directories. You can use the Acrobat SDK Documentation Roadmap as a guide to the directory structure.

See the Acrobat SDK Main Page to access the publicly-available Acrobat SDK. Alternatively, you can join the Adobe Solutions Network (ASN) Developer Program and install the Acrobat SDK directly from the Acrobat SDK CD. Technical support for the Acrobat SDK (Acrobat Developer Support) is not included for free. It is available to Adobe Solutions Network (ASN) Developer Program Premium members or may be purchased (except in Japan). For more information, see the ASN Developer Program Home Page.

Acrobat Developer FAQ

Acrobat Developer FAQ


Basic Acrobat SDK Questions

What Is a Plug-in?
Plug-ins are dynamically-linked extensions to the Acrobat viewers. They can hook into the user interface in a number of ways and can register to be called when a variety of events occur in the application. An Acrobat plug-in is a program written in ANSI C/C++ that uses the Acrobat core API and adds functionality to Acrobat or Acrobat Reader. A plug-in program le goes into a Plug_ins folder/directory and is initialized upon startup of the Acrobat viewers. Plug-ins are:

DLLs on Windows. On Windows, plug-in names must end in .API, not .DLL. Code fragments on Macintosh PowerPC Shared libraries on UNIX.
NOTE:

A UNIX version of Acrobat Reader 5.0 is scheduled to be released in early 2002. Information about developing plug-ins for this platform will be published at that time.

What Are Some Common Applications of the Acrobat SDK?


The Acrobat SDK is aimed at those who want to customize or modify how Acrobat looks and operates. The SDK offers the information necessary to customize and extend Acrobats functionality to meet your own needs. It documents and demonstrates the Acrobat core API capabilities and how to use the API. Some common uses of the Acrobat SDK are described below. For new applications that you can implement with the Acrobat 5.0 SDK, see What is New In the Acrobat 5.0 SDK? PDF File Viewing You can view a PDF le in your own applications window using Acrobat. (See How Can I Display a PDF File in an External Application Window? for more information.) Implementing Context Sensitive Help You can use Acrobat to implement a context-sensitive help system. Customizing the User Interface You can write a plug-in to add or change menu bars, menu items, or tool buttons (that is, customizing the user interface). See the BasicUI sample plug-in for an example of customizing the user interface. Controlling a Viewer Session You can control an Acrobat or Acrobat Reader session. See the DDEServer sample plug-in for an example of communicating with an Acrobat plug-in from an external application using DDE.

10

Acrobat Developer FAQ

Acrobat Developer FAQ


Basic Acrobat SDK Questions

Adding Annotation Types See the Stamper sample plug-in for an example of adding an annotation type. Adding Action Types You can add action types (such as going to a URL in a Web browser). See the ActionHandler sample plug-in for an example of adding an action type.

Where Do I Start with the Acrobat SDK?


The following documents are available from the documentation page on the Adobe Public Web Site and are on the Acrobat 5.0 SDK CD:

Getting Started Using the Adobe Acrobat Software Development Kit is an introduction to the SDK and its documentation. The Acrobat SDK includes a large number of sample applications and plug-ins to demonstrate how to use the APIs. Use the Guide to SDK Samples to locate appropriate samples. The Acrobat SDK Release Notes contain information relating to the latest release of the Acrobat SDK. The Acrobat Plug-In Tutorial provides instruction and examples showing how to create plug-ins using the Acrobat core API. The Acrobat Core API Overview provides a summary of the core API. The Acrobat Interapplication Communication Overview describes Acrobats facilities for interapplication communication (DDE and OLE automation on Windows and AppleScript and Apple events on the Macintosh).

Where Can I Find Guidelines On Developing Reader Plug-ins?


If you are considering the development of Reader plug-ins, bear in mind:

You may not develop a Reader plug-in that violates the restrictions listed in Section 3 of the Acrobat Reader Integration Key License Agreement. For technical limitations, see the following documents: Acrobat Core API Overview Acrobat IAC Overview For information on how to access the HFTs available to Reader plug-ins, see the Acrobat Development Overview.

The above documents are availabe from the documentation page on the Adobe Public Web Site and are on the Acrobat 5.0 SDK CD. For instructions on how to make your plug-in Reader-enabled, see the Acrobat SDK Main Page.

Acrobat Developer FAQ

11

Acrobat Developer FAQ


Basic Acrobat SDK Questions

How Is the API Organized?


The API organizes both the Acrobat viewers and PDF les into objects that plug-ins can manipulate. These objects have types, encapsulate their data, and are controlled by methods. This object-orientation is a conceptual model, implemented using a standard C API. The objects are organized into a hierarchy containing three layers:

The Acrobat Viewer layer (AcroView or AVModel) deals with the Acrobat viewer. Its methods allow plug-ins to manipulate components of the Acrobat viewer application itself, such as menus and menu items. The Cos Object System (Cos) layer provides access to the building blocks used to construct documents. Its methods allow applications to manipulate the low-level data in a PDF le, such as the dictionary and string objects. The Portable Document layer (PDModel) provides access to components of PDF documents. Its methods allow applications to manipulate document components such as fonts and document pages. PDFEdit methods treat page content as a list of objects whose values and attributes can be modied. PDFEdit allows you to read, write, edit, and create page contents and page resources, which may contain fonts, images, extended graphics states, and so on. PDSEdit methods allow you to access the logical structure information contained in a PDF document. A PDF documents logical structure is built independently of its physical representation, with pointers from the logical structure to the physical representation, and vice versa. Logical structure facilitates navigating, searching, and extracting data from PDF documents.

In addition to the above hierarchy, there are two other groups of functions available to plug-ins:

Acrobat Support (AS) methods provide platform-independent utility functions such as le handling mechanisms. The latter is important to document management systems that allow users to directly open les, and to online systems that provide dial-up access to remote documents. Platform-specic utilities are available only on specic platforms. For example, the Macintosh API provides methods for converting rectangles between Acrobat device coordinates and Macintosh screen coordinates, and for hooking into the Acrobat viewers Apple event handling loop. The UNIX API provides methods to read resources and obtain information about the environment in which the plug-in is running.

See the Acrobat Core API Overview for more information. The document is availabe from the documentation page on the Adobe Public Web Site and is on the Acrobat 5.0 SDK CD.

12

Acrobat Developer FAQ

Acrobat Developer FAQ


Licensing and Distribution

What Are the Requirements For Using Acrobat Forms?


The Acrobat Forms plug-in can be used to create, ll in and submit form elds in PDF les. Users of Adobe Acrobat Reader can ll in and submit forms, but not create them. Once a user lls out a PDF-based form, the data can be submitted to a server for processing. Data can be submitted from a PDF form in either FDF (Forms Data Format) or HTML. Data can only be imported into a PDF form if it is in FDF format. The FDF format is based on PDF; it is described in the PDF Reference (section 7.6.6 in the second edition, version 1.3). Every FDF le contains a reference to a PDF le that the data is intended for, designated with the /F key inside the FDF le (unless the FDF le is for the same form that you submitted from). When Acrobat or Acrobat Reader is sent an FDF le, it opens the appropriate PDF le, and lls the form elds with the data from the FDF le. If the PDF le is referenced by a URL (for example, http://yourcompany.com/file.pdf), the FDF le must be sent in response to a submit action from a PDF form. Acrobat plug-ins can programmatically import FDF data into a PDF le from a local le system using the HFT made available by the Forms plug-in. OLE Automation can be used to programatically add/modify/delete form elds, import/export FDF, execute Javascripts, and much more. For more information, see the Acrobat Forms API Reference.

What is the FDF Toolkit?


If you need to parse FDF les submitted from a PDF form, or generate FDF les to be submitted to a PDF form, you can use the Acrobat Forms Data Format (FDF) Toolkit. It is a thread-safe API for writing server-side applications that generate or parse FDF les, such as those created by Acrobat Forms. The FDF Tooklit supports COM on Windows, C and Perl on Windows, Solaris, AIX or Linux, and Java for all 1.2 or higher compatible VMs. For detailed information, see the documentation included with the FDF Toolkit. The FDF Toolkit is free and available on the Adobe public Web site at http://partners.adobe.com/asn/developer/acrosdk/forms.html.

Licensing and Distribution


What Should I Know About Acrobat Licensing and Distribution?
Some of the Acrobat products may be licensed for commercial redistribution: Acrobat (fee-based, license required) Acrobat includes:

Acrobat Developer FAQ

13

Acrobat Developer FAQ


Licensing and Distribution

Acrobat Acrobat Distiller Built-in plug-ins (such as Forms, Spelling, and PDF Consultant)

For OEMs and Integrators, Adobe offers special pricing for Acrobat 5.0 application. For more information, send e-mail to integrator-sales@adobe.com. Acrobat Reader You may distribute Acrobat Reader, subject to the terms set forth in the license agreement. However, you must use the installer that comes with Reader. You may call the Acrobat Reader installer (InstallShield 5.1) from your installer, but the installer must remain intact and the End User License Agreement (EULA) must be displayed at rst use. For information on customizing the Acrobat Reader installer, see Enterprise Installation. You may distribute Acrobat Reader via CD, as described on the Acrobat Reader Distribution Page. Acrobat Capture (fee-based, license required) Acrobat Capture 3.0X software is a stand-alone product and is not included as part of the Acrobat 5.0 product. It is licensed as a separate product. Low-volume Capture requires a hardware dongle that counts the pages processed; dongles are available with various page limits. For OEMs and Integrators, Adobe offers special pricing for Acrobat Capture. For more information, send e-mail to integrator-sales@adobe.com. Acrobat Toolkits

FDF Toolkit (free): The Acrobat Forms Data Format (FDF) Toolkit is a thread-safe API for writing server-side applications that generate or parse FDF les, such as those created by Acrobat Forms. The FDF Tooklit supports COM on Windows, C and Perl on Windows, Solaris, AIX or Linux, and Java for all 1.2 or higher compatible VMs. The FDF Toolkit is free and available on the Adobe public Web site at http://partners.adobe.com/asn/developer/acrosdk/forms.html. Adobe PDF Library (fee-based, license required): The Adobe PDF Library is an object code library that can be linked to your application. The Adobe PDF Library is not free and is not available on the Adobe public Web site.

For more information on the distribution of Acrobat, see the Acrobat Main Page. If you have Acrobat Technology licensing questions, please send e-mail with your contact information and some information about your product to integrator-sales@adobe.com. The appropriate person will contact you directly.

14

Acrobat Developer FAQ

Acrobat Developer FAQ


What Is and Is Not Supported in the Acrobat SDK

What Are the Licensing Restrictions and Requirements For Developing Acrobat Reader Plug-ins?
The Adobe Acrobat Reader Plug-in Program allows your plug-in, with certain restrictions (see license agreement), to run with the Acrobat Reader. An Adobe Acrobat Reader Integration Key License Agreement is required for this program. Download the PDF le of the agreement, which is located at the Acrobat SDK Main Page. Once you have the agreement, read and sign it, and then mail it to the ASN Developer Program to the address specied in the agreement with your license fee (faxed copies of the agreement will not be accepted).
NOTE:

You may not use the Acrobat Key to enable access to and/or display content secured using digital rights management services or technology unless you meet certain certication criteria in accordance with Adobes then-current certication process.

For European Developers, you must be a registered developer in the European Adobe Solutions Network Developer Program. For more information, send e-mail to euroasn@adobe.com.

What Is and Is Not Supported in the Acrobat SDK


In general, Acrobat Developer Support supports software development with the Acrobat core application programming interface (API), as documented in the Acrobat Software Development Kit. (Only registered members of the Adobe Solutions Network (ASN) Developer program are supported. For more information, see the ASN Developer Program Home Page.) Acrobat Developer Support does not support use of the product that does not involve the Acrobat core API. Any non-programmatic issues should be directed to Adobe Acrobat Technical Support. The supported development activities using the Acrobat SDK include those for which the product is designed, tested, and licensed.

What Development Environments are Supported By the Acrobat SDK?


The Acrobat core API and SDK are designed and tested to work with specic development environments. Development in other environments is unsupported. In general, Adobe supports the same operating systems for development as are supported for use by the application. The supported operating system for each application can be found in the product information on the Adobe Public Web Site.

Acrobat Developer FAQ

15

Acrobat Developer FAQ


What Is and Is Not Supported in the Acrobat SDK

The supported development environments are: Platform Windows Macintosh UNIX Development environment Visual C++ and Visual Basic, for plug-in development; Visual Basic, for OLE automation Metrowerks CodeWarrior See release notes for UNIX Reader (available early 2002)

For more information, including the supported versions of the compilers mentioned above, check the Acrobat SDK Release Notes.

What Uses Are Not Supported By the Acrobat SDK?


The following is a list of Acrobat Software Development Kit uses that are not supported. Most activities are identied as Technically Infeasible and/or Contrary to Licensing.

Use of any Acrobat product in a multithreaded way (Technically Infeasible) At this time, no Acrobat applications are multithreaded or thread-safe. Any multithreaded access of the Acrobat core API is likely to crash or hang the application. For more information pertaining to multithreaded use of Acrobat software, see Does the Acrobat SDK Support Multithreading? Use of any Acrobat product as a server process accessed by multiple clients, unless it is specically stated in product documentation as designed and licensed for such purpose (Technically Infeasible | Contrary to Licensing) Unless specically stated in the product documentation and licensing agreement, Acrobat products are not designed, tested, or licensed for this purpose. This use is in violation of the licensing restrictions, as described in the End User License Agreement displayed during Acrobat installation and not supported by Acrobat Developer Support. Use of Distiller as an NT service. (Technically Infeasible) Acrobat Distiller requires the ability to open a window on the desktop to run. It is not possible to use Distiller as an NT service. This feature request has been noted. Use of MenuItemExecute to bring up Acrobat dialog boxes when a PDF le is displayed in an external window using OLE Automation (Technically Infeasible) Due to problems of managing window focus, using the Acrobat dialog boxes (using MenuItemExecute) when a PDF le is displayed in an external window using OLE Automation is not supported. The actions executed by the dialog box may or may not affect the intended PDF le and there can be problems of windows not redrawing properly. The only supported workaround is to use the OLE Automation methods or to develop a plug-in to achieve any functionality not available in the

16

Acrobat Developer FAQ

Acrobat Developer FAQ


What Is and Is Not Supported in the Acrobat SDK

OLE API to Acrobat. The Acrobat Reader Integration Key License Agreement only permits displaying in an external window when Acrobat is used, not Reader.

Use of the PDF Reference, second edition, version 1.3 (and PDF: Changes From Version 1.3 to 1.4) to develop a third-party application that writes PDF les without the use of Adobe Acrobat products. We do not provide support to developers who are creating their own PDF generation capabilities without the use of Adobe products. The PDF Reference Manual is the best resource for this kind of development. The use of Adobe products to create PDF les as a benchmark for your own development is also a good resource. Acrobat Developer Support will not debug PDF les created with non-Adobe products. Questions regarding the completeness or accuracy of the PDF Reference will be answered. The PDF Reference is availabe from the documentation page on the Adobe Public Web Site and is on the Acrobat 5.0 SDK CD. Interapplication communication (IAC) between a plug-in and a third-party application. Interapplication communication between a plug-in and a third-party application does not differ signicantly from interapplication communication between two stand-alone applications. Documentation for your development platforms API and development environment are the best resources for this type of development. The Acrobat SDK contains two samples that can serve as examples. DDEServer demonstrates DDE communication between a stand-alone application and a plug-in. ExternalWindow uses Windows messaging to communicate with a standalone application. One typical difculty for developers occurs when a multithreaded stand-alone application communicates with a plug-in. See Does the Acrobat SDK Support Multithreading? for more information. Use of platform API methods or API methods of applications other than Acrobat. Acrobat Developer Support supports the API to the Acrobat product suite. Questions regarding the use of platform API methods should be directed to the manufacturer of your operating system. Use of the ActiveX Control or Netscape plug-in to display a PDF le in an external application besides Internet Explorer or Netscape. The methods used by Acrobat to display a PDF le in Netscape and Internet Explorer are intended only for use with these browsers. Use of the ActiveX Control and Netscape plug-in installed by Acrobat Reader is not licensed to other applications. Development with these interfaces is not supported and no documentation is available.

Acrobat Developer FAQ

17

Acrobat Developer FAQ


User and Developer Resources

Automating importing image les using the Import plug-in to Acrobat (Technically Infeasible). The Import plug-in to Acrobat does not provide an API that allows it to be called from a plug-in or another application. Executing the Import Image menu item with MenuItemExecute brings up a dialog box requiring user input. For information about other developer resources, see User and Developer Resources

What ActiveX Solutions Are Provided By the Acrobat SDK?


No ActiveX solutions are licensed for Acrobat or Acrobat Reader. There is no documentation on the PDF ActiveX Control in the Acrobat 5.0 SDK, and it is not supported. For more information on what development environments are supported with Acrobat, see What Development Environments are Supported By the Acrobat SDK?

Does the Acrobat SDK Support Multithreading?


No Acrobat products are multithreaded at this time and any attempts to access the Acrobat core API in a multithreaded manner will cause the viewer to hang or crash. Acrobat makes methods available that can help a plug-in or application manage its threads access to the Acrobat core API. These methods involve registering for notication of an event. This is accomplished with the following methods, as documented in the Acrobat Core API Reference (available from the documentation page on the Adobe Public Web Site and the Acrobat 5.0 SDK CD):

AVAppRegisterNotification AVAppRegisterIdleProc
When registering for a notication, the method is passed a function to be called by the Acrobat viewers when the event occurs. Registering for an IdleProc calls the function when nothing else is occurring. All notications and IdleProcs are queued and called in order. Registering for notications of events or IdleProcs can help a multithreaded application ensure that Acrobat is not accessed by multiple threads simultaneously; however, it is still the applications responsibility to manage its threads that access Acrobat.

User and Developer Resources


Where Can I Get Help With Acrobat Product Issues?
For information on using or installing Adobe Acrobat products, start at the

18

Acrobat Developer FAQ

Acrobat Developer FAQ


User and Developer Resources

Acrobat Product Support Page, which contains free downloads of the latest Acrobat product updates, answers to top product support issues, a searchable support database, user forums, and product support telephone numbers. For International customers, see the Adobe International Technical Support and Service Page.

How Can I Contact Adobe For Technical Support Issues?


If you have a technical support issue and do not nd your answer online, you can contact Adobe Acrobat Technical Support at the following numbers: Windows Mac OS UNIX 206-675-6304 206-675-6204 206-675-6404

What Is the ASN Developer Program and How Do I Join?


The Adobe Solutions Network Developer Program includes marketing tools and technical tools. For complete information on benets the ASN Developer Program, visit the Adobe Solutions Network Developer Program Home Page. Contact Information In the U.S. and Canada, and outside Europe, the Middle East, Africa, and Japan, contact: Adobe Solutions Network Adobe Systems Incorporated P.O. Box 609 Klamath Falls, OR 97601 For program information: Tel: +1-800-685-3510(US/Canada only) or +1-206-675-6145 Fax: +1-206-675-6872 For membership questions: E-mail: asndeveloper@adobe.com Web: Adobe Solutions Network Web Site

Acrobat Developer FAQ

19

Acrobat Developer FAQ


User and Developer Resources

In Europe, the Middle East, and Africa, contact: Adobe Solutions Network Edinburgh EH11 4GJ Scotland, United Kingdom For program information: Tel: +44 131 458 6800 Fax: +44 131 458 6801 For membership questions: E-mail: euroasn@adobe.com Web: Adobe Solutions Network Web Site In Japan, contact: Adobe Solutions Network Adobe Systems Co., Ltd. P.O. Box 43, Bunkyo Green Court Post Ofce 2-28-8 Hon-Komagome, Bunkyo-ku Tokyo 113-0021 Japan For program information: Tel: +81-3-5740-2620 Fax: +81-3-5740-2621 For membership questions: E-mail: asnjp@adobe.co.jp Web: Adobe Japan ASN Page Technical Support Support for the Adobe Acrobat SDK is available to Adobe Solutions Network (ASN) Developer Program Premium members or may be purchased (except in Japan). Technologies Supported The Acrobat Core API; Interapplication Communication (IAC), including Apple events; DDE; Adobe-generated Portable Document Format (PDF); pdfmark operator; command-line and initialization le interfaces; installer customization.

20

Acrobat Developer FAQ

Acrobat Developer FAQ


Acrobat and Acrobat Reader Comparison

Regular Updates and Upgrades Members receive updates to technical notes, development tools, and development software, as well as upgrades to the Acrobat SDK. Acrobat Software Development Kit (SDK) See What Is the Acrobat SDK?

What Adobe Resources Are Recommended to Acrobat Developers?


Information on Partner Resources Provides plug-ins and applications available from Adobe or third parties, Acrobat/PDF service providers, or links to pages on how to use the available plug-ins. Acrobat Main Page. Provides white papers and case studies of what can be done and what has been done with Adobe Acrobat.

What Developer Resources Are Provided by Outside Companies?


PDFZone provides resources that may be of help with developing and using the Acrobat products. These resources include forums, mailing lists, and an archive of previous mail. BCL-Computers provides tools that allow transfer of PDF objects (such as, tables) into Microsoft Word/Excel, and so forth. PlanetPDF provides PDF-related resources, hints, tips, and tricks. blueworld ListSearch provides search capability to Acrobat discussions.

Acrobat and Acrobat Reader Comparison


What Are the API Differences Between Acrobat and Acrobat Reader?
Acrobat is the full-featured development viewer. The entire Acrobat core API is available to Acrobat. The Acrobat Reader API is limited technically and legally. Technical limitations are documented in the Acrobat Core API Overview and the Acrobat IAC Overview. These documents are availabe from the documentation page on the Adobe Public Web Site and are on the Acrobat 5.0 SDK CD Both Acrobat and Acrobat Reader accept plug-ins. The primary difference between the two is that Reader can neither make changes to a le nor save a le. API methods that change a le in such a way that a save would be required are not available in Reader.

Acrobat Developer FAQ

21

Acrobat Developer FAQ


Visual Basic

NOTE:

Acrobat Reader only accepts Reader-enabled plug-ins. For more information, see PDF Documents For additional legal restrictions, see the Acrobat Reader Integration Key License Agreement.

What Are the Technical Limitations of Using the Interapplication Communication (IAC) API With Acrobat Reader?
Acrobat Reader does not support OLE automation, as stated in the Acrobat IAC Overview (availabe from the documentation page on the Adobe Public Web Site and the Acrobat 5.0 SDK CD). Acrobat Reader supports only the following DDE messages: CloseAllDocs, DocClose, DocGoTo, DocGoToNameDest, DocOpen, FileOpenEx, FilePrintEx, FilePrintSilentEx, FilePrintToEx, and AppExit. Acrobat Reader supports only the four required Apple events: run, open, print, and quit. There are licensing restrictions on what functionality may be added to Acrobat Reader by plug-ins. You may not write a plug-in which accepts navigational commands from another application or which displays a PDF document in the window of another application. See the Acrobat Reader Integration Key License Agreement.

Visual Basic
How Can I Use Visual Basic with the Acrobat SDK?
The Microsoft Windows version of Acrobat is an OLE Automation server. In order to use the OLE objects made available by Acrobat, you must have the full Acrobat product installed on your system and the Acrobat.tlb le included in the project references for your Visual Basic project. This allows you to use the Visual Basic object browser to browse the OLE objects. Beginning in Acrobat 5.0, you can access Acrobats JavaScript object model through the OLE Automation interface. See the JSObjectAccess sample. For more information, see Programming Acrobat JavaScript Using Visual Basic.

What Are the Best Resources For Getting Started Using Visual Basic With the Acrobat SDK?
The Acrobat IAC Overview and Acrobat IAC Reference describe the objects and methods available. These documents (as well as the API) were designed with C programming in mind and programming with the API requires some familiarity with C concepts such as enums. The documents are availabe from the documentation page on the Adobe Public Web Site and are on the Acrobat 5.0 SDK CD.

22

Acrobat Developer FAQ

Acrobat Developer FAQ


Visual Basic

Besides the object browser, the best resources for a Visual Basic programmer are the sample projects. The samples demonstrate use of the Acrobat OLE objects and contain comments describing the parameters for the more complicated methods. The Iac.bas le in the InterAppCommunicationSupport\Headers folder contains the Visual Basic counterparts to the C #defines and enumerations passed to many of the API methods.

How Can I Use Visual Basic and the Registry To Launch Acrobat or Acrobat Reader?
The following Visual Basic sample code launches Acrobat or Reader, based on its registry entry. This script extracts the registry entries generated by Acrobat to verify installation and then uses the specied path to launch the Acrobat viewer. If both Acrobat and Reader are installed, only Acrobat is launched. 1. Copy and paste the code sample into VBProject. Some reformatting may be necessary.
Private Declare Function RegOpenKeyEx Lib "advapi32" Alias _ "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal _ dwReserved As Long, ByVal samDesired As Long, phkResult As Long) As Long Private Declare Function RegQueryValueEx Lib "advapi32" Alias _ "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName$, ByVal _ lpdwReserved As Long, lpdwType As Long, lpData As Any, lpcbData As _ Long) As Long Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) _ As Long Const HKEY_LOCAL_MACHINE As Long = &H80000002 ' ' 'From FAQ the Acrobat Reader can be found at "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe" ' ' Function RegGetString$(hInKey As Long, ByVal subkey$, ByVal valname$) Dim RetVal$, hSubKey As Long, dwType As Long, SZ As Long Dim R As Long RetVal$ = "" Const KEY_ALL_ACCESS As Long = &H3F Const ERROR_SUCCESS As Long = 0 Const REG_SZ As Long = 1 R = RegOpenKeyEx(hInKey, subkey$, 0, KEY_ALL_ACCESS, hSubKey) If R <> ERROR_SUCCESS Then GoTo Quit_Now SZ = 256: v$ = String$(SZ, 0)

Acrobat Developer FAQ

23

Acrobat Developer FAQ


Visual Basic

R = RegQueryValueEx(hSubKey, valname$, 0, dwType, ByVal v$, SZ) If R = ERROR_SUCCESS And dwType = REG_SZ Then SZ = SZ - 1 RetVal$ = Left$(v$, SZ) Else RetVal$ = "--Not String--" End If If hInKey = 0 Then R = RegCloseKey(hSubKey) Quit_Now: RegGetString$ = RetVal$ End Function

Function Acrobat_viewer() As String Dim ViewerStr As String ViewerStr = RegGetString$(HKEY_LOCAL_MACHINE, _ "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Acrobat.exe", _ "Path") If ViewerStr <> "" Then ViewerStr = ViewerStr + "\Acrobat.exe" Debug.Print "Using Acrobat" Else ' Acrobat is not installed ViewerStr = RegGetString$(HKEY_LOCAL_MACHINE, _ "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ _AcroRd32.exe", "Path") ViewerStr = ViewerStr + "\AcroRd32.exe" Debug.Print "Using Reader" End If Acrobat_viewer = ViewerStr End Function ' ' Private Sub Command1_Click() Unload Me End End Sub ' ' Private Sub Form_Load() Dim myRetVal As Integer Dim ShellStr As String ' Should really check to see if there is a viewer already running ' Get the path to the Reader from the registry ShellStr = Acrobat_viewer() '"C:\Program _ Files\Acrobat3\Reader\AcroRd32.exe" ' Launch the application myRetVal = Shell(ShellStr, vbHide) ' Set up appropriate DDE values and ask viewer to display a file. Text1.LinkMode = 0 ' End any previous sessions

24

Acrobat Developer FAQ

Acrobat Developer FAQ


Enterprise Installation

Text1.LinkTopic = "acroview|control" ' This is known Text1.LinkMode = 2 Text1.LinkTimeout = 32767 ' Make the timeout suitable for any delay Text1.LinkExecute "[FileOpen(c:\acrobat3\exchange\license.pdf)]" End Sub

2. Create a form with a text eld and a button. 3. Verify that the path of the PDF le that will be launched is valid.

Enterprise Installation
How Can I Customize the Acrobat Installer?
Adobe provides various ways in which you can install Acrobat 5.0 to a large number of systems. You can nd documentation about Enterprise Installation at http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html including these technical notes:

Extending The Adobe Acrobat Installer On The Windows Platform , which has information on manually changing settings in the ABCPY.ini and setup.iss les to customize your installation Deploying Adobe Acrobat Installer Using SMS, which has information on deploying Acrobat to your enterprise customers via SMS Deploying Adobe Acrobat Using Microsoft Windows Terminal Service, which has information on deploying Acrobat to your enterprise customers via Windows Terminal Service Adobe Acrobat Enterprise Installation Tool, which has step-by-step instructions for using an application that takes you through some of the more common enterprise customization procedures

PDF Documents
What Options Do I Have To Generate PDF?
Four methods are available for PDF creation. The rst three described below are supported by Acrobat Developer Support. Acrobat Distiller Acrobat Distiller is essentially a PostScript interpreter that can be used to convert PostScript to PDF. For more information on the Distiller program, go to the Acrobat Main Page. Distiller is the PDF creation application intended for batch processing use

Acrobat Developer FAQ

25

Acrobat Developer FAQ


PDF Documents

and for the creation of PDF les containing such high-end print publishing features as OPI comments, CMYK color spaces, and spot colors. Distiller also has the ability to interpret PostScript extensions called pdfmarks and convert them to PDF objects such as links, bookmarks, and annotations. See the pdfmark Reference available from the documentation page on the Adobe Public Web Site and on the Acrobat 5.0 SDK CD. These high-end capabilities do not exist in PDFWriter. Due to the built-in functionality of Distiller, you do not need to use the Distiller API to integrate it with your product. Distiller has the ability to watch directories over a network and to convert any PostScript les saved to those directories to PDF. It is also possible to set different job options for each directory so that one directory can be used for high-end color output, while the other can generate a more compressed le suitable for Web use. These features of Distiller are not supported by Acrobat Developer Support. Check the help documentation packaged with the product or books by Adobe Press and other publishers for using Acrobat Distiller through the user interface. The Acrobat Distiller API can be used to programmatically process les and set the output path and le names. The API is documented in the Acrobat Distiller API Reference available from the documentation page on the Adobe Public Web Site and on the Acrobat 5.0 SDK CD.
NOTE:

Server use of the Distiller software isn't allowed. The End User License Agreement allows for use only on a single system. Access to, and use of, the Distiller software over a network is prohibited. The only exception is installation of the software. You are permitted to keep a copy of the software on a server so that users who have a license for the software can download and install it. A separate product, Acrobat Distiller Server, can be purchased or licensed from Adobe for server use. See What Is and Is Not Supported in the Acrobat SDK for more information.

PDFWriter PDFWriter emulates a printer driver and converts the GDI or QuickDraw commands from Windows and Macintosh applications to PDF documents. It is only available on the Windows and Macintosh platforms and is intended for desktop use by applications. For more information on PDFWriter, go to the Acrobat Main Page. PDFWriter is a client resource and can not be used as a server facility. Use of PDFWriter on a server or with simultaneous access from multiple applications or clients is unsupported and violates the terms of the End User License Agreement provided with the product. See What Is and Is Not Supported in the Acrobat SDK for more information. The PDFWriter API is documented in the Acrobat PDF Writer API Reference, available from the documentation page on the Adobe Public Web Site and on the Acrobat 5.0 SDK CD. Acrobat Capture 3.0X Acrobat Capture 3.0X is a separate SDK from the Acrobat SDK. It is designed for the batch conversion of image les to PDF and the recognition of the text in the resulting

26

Acrobat Developer FAQ

Acrobat Developer FAQ


PDF Documents

PDF les to create searchable text PDF les. For more information on the Acrobat Capture 3.0X SDK, see the ASN Software Development Kits Page.

Generating PDF Files without Using Adobe Products


Some developers have successfully developed the capability of generating PDF from their own applications without using Adobe Products. This development is not supported by Acrobat Developer Support. The best resources for this kind of development are:

PDF Reference, which fully documents the PDF 1.3 specication PDF: Changes From Version 1.3 to 1.4, which provides PDF 1.4 format details

These documents are available on the Acrobat 5.0 SDK CD. The PDF Reference also is available from the documentation page on the Adobe Public Web Site. A third resource is Adobe products you can use to create PDF les as a benchmark for your own development. The PDF le format is quite complex, and developing code to generate it requires a signicant amount of development. In estimating development time, we suggest you look at the methods used to compress and encrypt the page content streams, as well as the requirements of the byte offset table at the end of the PDF le. The LZW compression technique is the subject of United States patent number 4,558,302 owned by the Unisys Corporation. Independent software vendors may be required to license this patent directly from Unisys to develop software using LZW. Further information can be obtained from Welch Licensing Department, Law Department, M/S C2SW1, Unisys Corporation, Blue Bell, Pennsylvania, 19424.

What API Methods Are Available to Modify PDF Documents?


Modifying the page contents of a PDF le is primarily accomplished using the Acrobat core API. Acrobats automation API is limited mainly to what a user can do through the user interface so, while it is possible perform such tasks as set DocInfo elds, create thumbnails, and add text notes, it is not possible to signicantly modify the contents of a page. PDF modication is not possible with the free Acrobat Reader. The AddText and AddImage sample plug-ins demonstrate how to add data to the contents of a page. Using the Acrobat core API greatly simplies modifying and creating PDF page contents. In addition, Acrobat updates the byte offset table and page resources to ensure that the PDF le is still readable after modication. If this were attempted by parsing and rewriting the page contents without using the core API, it would be signicantly more difcult to do and could result in an unreadable PDF le. The Acrobat core API is discussed in the Acrobat Core API Overview and Acrobat Core API Reference. These documents are available from the documentation page on the Adobe Public Web Site and on the Acrobat 5.0 SDK CD.

Acrobat Developer FAQ

27

Acrobat Developer FAQ


PDF Documents

What Options Do I Have to Modify PDF Documents Without C Programming Background?


You can make some modications to PDF les through JavaScripting. For details, see the Acrobat JavaScript Object Specication, which is located in the Acrobat 5.0 Help menu. This document provides all the information you need to get started using JavaScript. It serves as a reference to Acrobats JavaScript objects, properties, and methods. In addition, it provides instruction on the basics of JavaScript programming, supported by useful examples.

How Can I Extract Text From PDF Documents Using the Acrobat SDK?
You can extract text with the Acrobat SDK in two ways:

Use the Acrobat core API Use Acrobats automation API

Through the core API, you can extract ASCII text from a PDF le using Acrobat and a plug-in developed in C or C++. The Wordfinder sample plug-in demonstrates text extraction and can be used as a starting point for your own plug-in. AVConversion methods also can be used to save PDF as text or rich text. You can also extract text with Acrobats automation API.

How Can I Display a PDF File in an External Application Window?


There are several ways to have the Acrobat program display a PDF le in an external applications window. You must have Acrobat installed on the system to view PDF in your own applications window.
NOTE:

This is not supported or licensed for Acrobat Reader.

There is no best way that we suggest to display PDF les in your application; you should examine the following list for the most appropriate method for your situation. Using Acrobat to View a PDF in Your Own Applications Window Windows Only:

OLE automation, using the OpenInWindowEx command. This displays a live view of the PDF le in the OLE application window. For samples, see the Visual Basic and C++ ActiveView applications. OLE automation, using the DrawEx command. This displays a bitmap of the current page in the OLE application window. For samples, see the Visual Basic and C++ StaticView applications. Copy to Clipboard. This copies a PDF image to the clipboard without requiring an hWnd or hDC using OLE Automation.

Mac OS Only:

28

Acrobat Developer FAQ

Acrobat Developer FAQ


PDF Documents

The AcroAppleEvents sample application demonstrates rendering a PDF le into another applications window (see DrawIntoWindowCommand for details). The ExternalWindow sample plug-in demonstrates a live view of the PDF le in a window created by the plug-in. You can extend this to display PDF les in an external application window.

Windows and Mac OS:

Using Acrobat Reader to Display a PDF in Your Own Applications Window Due to restrictions in the Acrobat Reader Integration Key License Agreement, you cannot write a plug-in to display PDF les in an external window. Adobe does not support or license development using the Acrobat ActiveX (OCX) component that ships with Acrobat and Acrobat Reader. Its purpose is to integrate with Internet Explorer. Adobe has no documentation available regarding ActiveX (OCX) development with Acrobat.

Are Multibyte PDF Documents Supported by the Acrobat SDK?


PDF les can have multibyte fonts. Acrobat allows the creation, modication, and use of multibyte PDF les. In multibyte documents, both text and other document information, such as bookmarks or text annotations, may be in multibyte format. Several plug-in samples illustrate handling multibyte PDF documents. The API provides methods for handling multibyte documents. For samples, see the BasicUI and Wordfinder sample plug-ins.

How Is Security Provided in PDF Documents?


Adobe provides an encryption scheme with Acrobat that queries the user for a password before a le is opened. The authorization procedure to open a le or to set an owner password can be modied by creating a custom security handler. Using a custom security handler, you can:

Set up a secure CD-ROM where the PDF les can be opened without a password when they are on the CD and the plug-in is installed, but cannot be opened if they are moved to a system without the plug-in and the special le that existed on the CD. Set up a nger print scanner that determines if the user can open a PDF le and communicates with the plug-in to authorize the user to open the le. Set up a Web site that requires a user to have a particular IP address to open one of the les (that the plug-in would check before authorizing the le to be opened). PDF Reference and the Acrobat Core API Overview, both of which are available on the Adobe Public Web Site and are on the Acrobat 5.0 SDK CD

For more information on encryption in PDF, see the following documents:

Acrobat Developer FAQ

29

Acrobat Developer FAQ


Full-Text Search

PDF: Changes From Version 1.3 to 1.4, which is available on the Adobe Public Web Site

For samples of setting security, see the SecurityHandler and SetSecurity sample plug-ins. To programmatically enter a password and bypass the user interface prompt for password, you must replace the standard security handler for Acrobat with your own security handler. There is no way to bypass the password prompt with the standard Acrobat security handler. For an example of a custom security handler, see the SecurityHandler sample plug-in.

Full-Text Search
What Tools Are Available with Acrobat For Full-Text Search?
Adobe provides a full-text-search system based on the Verity search engine. However, this does not preclude other search systems from integrating with Acrobat. The Acrobat search system was created using only public API and IAC calls, and you can easily remove it from Acrobat and replace it with another search technology. This section describes the tools available to full-text-search developers and the process for integrating full-text-search systems with Acrobat.

What Tools Are Available for Extracting and Highlighting Text?


For indexing and searching PDF les directly, Acrobat provides support through IAC and plug-in calls. For indexing PDF les, Acrobat provides text extraction APIs. Text extraction also supplies position information that can be used to highlight search hits in the original PDF le. The text extraction tools are provided as calls in the plug-in API on the Acrobat viewer platforms (Mac OS and Windows). For further information on extracting text from PDF, see How Can I Extract Text From PDF Documents Using the Acrobat SDK? For samples, see the Wordfinder plug-in.

What Types of Search Plug-ins are Available for the Acrobat Viewer?
The Acrobat Search plug-in that is provided with the Acrobat viewer is a true Acrobat plug-in. As such, you can remove it from the system simply by removing it from the Plug-ins directory and restarting Acrobat. Full-text-search developers can create their own search plug-in by using the Acrobat core API.

30

Acrobat Developer FAQ

Acrobat Developer FAQ


Full-Text Search

This search plug-in can be represented as one or more toolbar buttons or menu items, and it can use the capabilities provided in the API. When creating a replacement search plug-in for the Acrobat viewer, you must decide what indices your search plug-in will use. You can either create your own indices (see What Tools Are Available for Extracting and Highlighting Text?) or search the Verity indices created by the Acrobat Catalog plug-in. To do the latter, you must license software directly from Verity. The Verity can be contacted at the Verity Home Page. The viewer interface can be extended with new menus and toolbar icons to allow tight integration with your search plug-in and Acrobat. For example, buttons to invoke a search and to nd the next or previous occurrences can be added to the toolbar. For samples of adding menu items and toolbar buttons, see the BasicUI plug-in.

How Do I Communicate with the Acrobat Search Plug-in?


You can communicate with the Search plug-in via its plug-in API or via IAC (DDE or Apple events). Using either of these methods, you can control the Acrobat Search plug-in in the following ways:

Control the list of indices to search The search interface allows for searches to be performed on one or more of the available indices. You can control the list of active indices. Initiate a search with options You can pass query expressions and search settings (for example, whole words only, word stemming, case sensitive, and so forth) to the Acrobat search plug-in and initiate the search. Search results will be presented to the user.

For samples, see the SearchQuery plug-in and SearchPDF Visual Basic application. For documentation, see the Acrobat Search API Reference (available on the Adobe Public Web Site and the Acrobat 5.0 SDK CD).

How Do I Create Custom Doc Info Fields For Searching?


You must create the custom DocInfo elds using either the Acrobat core API or using Interapplication Communication (IAC). If you specify a non-standard DocInfo eld with the core API or IAC, it will be created. See the Acrobat Core API Reference and the Acrobat IAC Reference for more information. Before indexing the PDF les with Acrobat Catalog, modify the registry settings so that the custom elds are properly indexed. This is explained in the online help les included with the Acrobat Catalog product. Submit custom queries to the Acrobat Search plug-in to search by the custom elds, as demonstrated by the SearchQuery sample plug-in. The documentation for the search API is the Acrobat Search API Reference. By specifying your custom DocInfo

Acrobat Developer FAQ

31

Acrobat Developer FAQ


Miscellaneous Technical Issues

elds in the sortSpec parameter of the SearchExecuteQuery method, they will be used in the search. The above documents are available on the Adobe Public Web Site and are on the Acrobat 5.0 SDK CD.

Miscellaneous Technical Issues


How Do I Use Command Lines with Acrobat and Acrobat Reader on Windows?
These are unsupported command lines, but have worked for some developers. There is no documentation for these commands other than what is listed below. You can display and print a PDF le using command lines with Acrobat and Acrobat Reader.

AcroRd32.exe filename Executes the Reader and displays a le.


Other options for the command line are: option meaning
Launch a separate instance of the Acrobat application, even if one is currently open. Open Acrobat, suppressing the splash screen. Open Acrobat, suppressing the open le dialog. Open Acrobat in hidden mode.

/n /s /o /h

AcroRd32.exe /p filename Executes the Reader and prints a le. AcroRd32.exe /t path printername drivername portname Initiates
Acrobat Reader, prints a le while suppressing the Acrobat print dialog box, then terminates Reader. The four parameters of the /t option evaluate to path, printername, drivername, and portname (all strings).

printername The name of your printer. drivername Your printer drivers name. Whatever appears in the Driver Used box
when you view your printers properties.

portname The printers port. portname cannot contain any "/" characters; if it
does, output is routed to the default port for that printer. If using Acrobat, substitute Acrobat.exe in place of AcroRd32.exe in the command lines.

32

Acrobat Developer FAQ

Você também pode gostar