Adobe acrobat 7.0.5 sdk User Manual

Page of 122
Deciding Which Acrobat SDK Technology to Use
Deciding Between Plug-ins and JavaScript
3
32
N
O T E
:
Subsequent chapters of this document discuss specific tasks you can do using the 
Acrobat SDK and which technologies you can use to perform those tasks.
General Issues
The table below lists other general issues that are relevant to deciding between plug-ins 
and JavaScript.
T
ABLE
 3.2
Plug-ins vs. JavaScript - General Issues
Scope
A plug-in affects all PDF documents viewed by Acrobat.
JavaScript can affect either a single document or all PDF 
documents in a particular folder.
Installation/ 
Distribution
Plug-ins must be placed in the 
Plug_ins
 folder or directory by 
an installer or by the user. 
Document-level JavaScripts are easier to distribute since they can 
be included directly within the PDF file and do not require an 
installer. Folder-level JavaScripts must be placed in the Acrobat 
application JavaScript folder or the user’s JavaScript folder.
Low-level Access 
Plug-ins can access and manipulate low-level objects in the PDF 
object model, such as the Cos layer.
JavaScript scripts can only access a limited set AV and PD layer 
objects.
Execution Speed
Plug-ins are compiled and loaded when Acrobat initializes.
Execution of JavaScript code is generally slower than plug-in code 
because it is interpreted instead of compiled. The difference is 
noticeable only in very computation-intensive applications, such 
as a full-text search in a large PDF file.
Ease of 
Implementation
Plug-ins are developed in C or C++ and are compiled and linked in 
the appropriate development environment. You must be careful to 
include all necessary header files for your application. 
JavaScript scripts are easier to write and implement since they are 
developed using the editor and debugger that come as part of 
Acrobat Professional. Developers can also use an external editor to 
create and edit JavaScripts.
Cross-platform 
compatibility
Plug-ins must be built on different platforms to handle certain 
platform-specific issues. 
JavaScript is cross-platform compatible.