Adobe 12001196 Scripting Guide

Adobe 12001196 - Acrobat - Mac Manual

Adobe 12001196 manual content summary:

  • Adobe 12001196 | Scripting Guide - Page 1
    Acrobat JavaScript bc Scripting Guide Technical Note #5430 Version: Acrobat 6.0 ADOBE SYSTEMS INCORPORATED Corporate Headquarters 345 Park Avenue San Jose, CA 95110-2704 (408) 536-6000 http://partners.adobe.com May 2003
  • Adobe 12001196 | Scripting Guide - Page 2
    that purport to be merely compatible with the PostScript language. Adobe, the Adobe logo, Acrobat, the Acrobat logo, Acrobat Capture, Distiller, PostScript, the PostScript logo, and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other
  • Adobe 12001196 | Scripting Guide - Page 3
    Preface 7 Introduction 7 Audience 7 Purpose and Scope 7 Assumptions 8 Organization 8 How To Use This Guide 8 Font Conventions Used in This Book 9 For More Information 10 Chapter 1 Introduction to Acrobat JavaScript 11 Introduction 11 Chapter Goals 11 Contents 11 Overview 11 What Is
  • Adobe 12001196 | Scripting Guide - Page 4
    Acrobat JavaScript Editor 24 Using an External Editor 24 Additional Editor Capabilities 24 Specifying Additional Capabilities to Your Editor 25 Testing Whether Your Editor Supports Window 40 Scripts Inside PDF Files 40 Scripts Outside PDF Files 41 Call Stack Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 5
    Combo Box 67 List Box 70 Radio Button 71 Signature 72 Text 73 Appendix A A Short Acrobat JavaScript FAQ 75 Where can JavaScripts be found and how are they used 75 Folder Level JavaScripts make my document secure 81 Restricting Access to the Document 81 Acrobat JavaScript Scripting Guide 5
  • Adobe 12001196 | Scripting Guide - Page 6
    Contents Restricting Permissions 81 Digital Signatures 81 How can I make restricted Acrobat JavaScript methods available to users 82 How can I lock a document after a signature 87 How can I determine if the mouse has entered/left a certain area 88 6 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 7
    access to the necessary knowledge resources. This guide is one of those resources. Purpose and Scope The objectives of this guide include: ● Introducing you to the Adobe Acrobat JavaScript functionality that supports developing and deploying Acrobat solutions. ● Providing you with easily understood
  • Adobe 12001196 | Scripting Guide - Page 8
    To work through the exercises in this guide, you must have access to Acrobat 6 Pro. Organization This guide is divided into the following chapters and Acrobat, unless otherwise noted. 2. Create a JavaScript exercises directory on your local hard drive. You will use this directory to store the PDF
  • Adobe 12001196 | Scripting Guide - Page 9
    ://partners/adobe.com/asn/ Live links to sections within this document See Using the SDK. Live links to other See the AcrobatCoreAPIOverview. Acrobat SDK documents Live links to code items Test whether an ASAtom exists. within this and other Acrobat SDK documents PostScript language and PDF
  • Adobe 12001196 | Scripting Guide - Page 10
    /) This documentation consists of: - Core JavaScript Guide - Core JavaScript Reference ● Acrobat eForms Solution Training (http://partners.adobe.com) ● Acrobat Review and Markup Training (http://partners.adobe.com) ● Portable Document Format (PDF) Reference, Version 1.4 In this document, references
  • Adobe 12001196 | Scripting Guide - Page 11
    This chapter introduces Adobe Acrobat JavaScript. The JavaScript development environment for Acrobat 6, which includes new debugging capabilities, is only supported on the Acrobat Pro "flavor" of Acrobat 6. This guide shows a variety of ways that you can use Acrobat JavaScript to implement
  • Adobe 12001196 | Scripting Guide - Page 12
    PDF files. Acrobat also contains functionality to support online team review. Documents that are ready for review are converted to Adobe PDF. When a reviewer views an Adobe PDF document in Acrobat onto a client in Web-based applications. Acrobat JavaScript implements extensions, in the form of
  • Adobe 12001196 | Scripting Guide - Page 13
    Acrobat JavaScript? Acrobat JavaScript enables you to do a wide variety of things within a PDF document. The Adobe Solutions Network (ASN) has an Adobe Acrobat interacts with a PDF document, mouse clicks or event. Acrobat detects when the Acrobat application Acrobat gives parameters for a PDF. They are
  • Adobe 12001196 | Scripting Guide - Page 14
    for a page that can be added dynamically to an existing PDF document. See the ASN JavaScript training module on "Templates and comment repository preference If you plan on using Adobe Acrobat's collaborative review capabilities, you need to Acrobat. See the 14 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 15
    PDF documents and customize Acrobat by adding menus and menu items. You can also query App to determine which type of Adobe product (for example, Reader, Approval, or full Acrobat items found within a PDF document, such as bookmarks an inheritance hierarchy. Acrobat JavaScript is no different
  • Adobe 12001196 | Scripting Guide - Page 16
    underlying document. Other Common Acrobat JavaScript Objects Several objects exist independently of the PDF document. In addition to and executing JavaScript. It does not function in the Adobe Reader or Acrobat Standard. Use the Console object as a debugging aid Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 17
    database by using the ADBC, Connection, and Statement objects. These Acrobat-specific JavaScript objects constitute Acrobat Database Connectivity (ADBC) and utilize ODBC calls to establish a connection without affecting the value you thought you were changing. Acrobat JavaScript Scripting Guide 17
  • Adobe 12001196 | Scripting Guide - Page 18
    1 Introduction to Acrobat JavaScript Acrobat JavaScript Object Overview 18 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 19
    you use to write your code. ● Identify the extra capabilities that Acrobat supports on some external editors. ● Invoke the JavaScript console and use it Acrobat JavaScript Editor Using an External Editor Exercises Exercise: Working with the JavaScript Console Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 20
    Console The Acrobat JavaScript console provides the JavaScript Console To open the Acrobat JavaScript console from within the Acrobat application: 1. Open the debugger window . Be aware that when evaluating a block of code, Acrobat only automatically prints to the console the result from the
  • Adobe 12001196 | Scripting Guide - Page 21
    Acrobat JavaScript Editor and Debugger Console 2 Using a JavaScript Editor ● To move the cursor four spaces to the left, press Shift+ Up or Page Open) that will execute the JavaScript action. 4. Select Run a JavaScript from the Select Action drop-down list. Acrobat JavaScript Scripting Guide 21
  • Adobe 12001196 | Scripting Guide - Page 22
    2 Acrobat JavaScript Editor a JavaScript action with an object at various locations (or "levels") in a PDF document. For example, you can associate a script at the location of a particular at different locations within a PDF document and at the application level, see the ASN JavaScript training
  • Adobe 12001196 | Scripting Guide - Page 23
    the built-in JavaScript editor that comes with Acrobat, or an external JavaScript editor of your choice Editor in Preferences The Acrobat JavaScript Editor option sets the built-in Acrobat JavaScript editor as the by browsing, Acrobat adds command options to the editor command. For
  • Adobe 12001196 | Scripting Guide - Page 24
    Acrobat, that program is used any time a JavaScript has to be edited from inside Acrobat. Acrobat Acrobat to see your changes. In addition, Acrobat Acrobat. Additional Editor Capabilities Acrobat is able to support supported Since Acrobat does must instruct the instruct it to invoke a new
  • Adobe 12001196 | Scripting Guide - Page 25
    names are properly handled. ● Is there a way to instruct the editor to open a file and jump to a there is no line number to jump to, Acrobat supports having that portion of the command be optional, Acrobat to properly recognize it and substitute the template. Acrobat JavaScript Scripting Guide 25
  • Adobe 12001196 | Scripting Guide - Page 26
    .com +new "%f" [-#%n] Testing Whether Your Editor Supports Opening at Syntax Error Locations On a few editors such as TextPad, Acrobat does not support opening the editor on a line number. To does it correctly specify the line containing the syntax error? 26 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 27
    , for example), Acrobat displays a dialog box Acrobat discards your file. Always click Yes. Acrobat Acrobat 6 Pro installed on your machine. In this exercise you will verify that JavaScript is enabled for Acrobat and then begin working with the Acrobat Acrobat Acrobat: 1. Launch the Acrobat Acrobat
  • Adobe 12001196 | Scripting Guide - Page 28
    enable the debugger. 1. In the Preferences dialog, select Enable JavaScript Debugger after Acrobat is restarted from the JavaScript Debugger options. 2. Select Enable interactive console. This , as shown in Figure 2.4. FIGURE 2.4 Console window in debugger 28 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 29
    Acrobat JavaScript Editor and Debugger Console 2 Exercise: Working with the JavaScript Console 3. Click the Clear button (trash can icon) console window, highlight the variable name and press Enter or Ctrl+Return. You should see the results shown in Figure 2.6. Acrobat JavaScript Scripting Guide 29
  • Adobe 12001196 | Scripting Guide - Page 30
    2 Acrobat JavaScript Editor and Debugger Console Exercise: Working with the JavaScript Console FIGURE 2.6 Evaluating myNumber 7. Now evaluate the character \n to force a new line. The results in the console window should appear as shown in Figure 2.7. 30 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 31
    Acrobat JavaScript Editor and Debugger Console 2 Exercise: Working with the JavaScript Console FIGURE 2.7 Evaluating a code line The console.println() . It prints the text that you specify and then returns undefined. 8. Click Close to close the debugger dialog. Acrobat JavaScript Scripting Guide 31
  • Adobe 12001196 | Scripting Guide - Page 32
    2 Acrobat JavaScript Editor and Debugger Console Exercise: Working with the JavaScript Console 32 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 33
    breakpoints and inspect variable values while stepping through code. The debugger is not available in the Acrobat Reader. Debugging is controlled with a single dialog that you can open from the Acrobat menu item Advanced > JavaScript > Debugger. If the debugger dialog is not open and you happen to
  • Adobe 12001196 | Scripting Guide - Page 34
    Calculator Known Issues Enabling the Acrobat JavaScript Debugger Before you can use dialog to control the behavior of the Acrobat JavaScript development environment. Enabling JavaScript and ... option is checked. Note that you must restart Acrobat for this option to take effect. Other options for
  • Adobe 12001196 | Scripting Guide - Page 35
    features such as setting breakpoints become available Acrobat is restarted for you to use the next time you launch Acrobat. Store breakpoints in PDF file This option enables you to store Yes enables the interactive console from within the debugger. Acrobat JavaScript Scripting Guide 35
  • Adobe 12001196 | Scripting Guide - Page 36
    script to debug by using the Acrobat menu item Advanced > JavaScript > Debugger in a tree hierarchy, such as the the one illustrated in Figure 3.2. Please note the distinction between the This is described in detail in Chapter 2, "Acrobat JavaScript Editor and Debugger Console". ● Script and Console
  • Adobe 12001196 | Scripting Guide - Page 37
    JavaScript Debugger 3 Debugger Buttons Debugger Buttons The Acrobat JavaScript Debugger allows you to easily control what portions of the script you want to see overview of their use together is in the section on "Stepping Through Your Code" on page 47. Acrobat JavaScript Scripting Guide 37
  • Adobe 12001196 | Scripting Guide - Page 38
    Acrobat instructions but does not enter function calls encountered. Step Into Single steps through instructions function call, and stops on the instruction immediately following the call to the that results in running a JavaScript script in Acrobat will cause execution to stop at the beginning of
  • Adobe 12001196 | Scripting Guide - Page 39
    Acrobat JavaScript Debugger 3 Debugger Buttons Quit The Quit button terminates the debugging session and closes the debugger dialog window. Step Over The Step Over button single-steps through instructions. end of the script or until a breakpoint is reached. Acrobat JavaScript Scripting Guide 39
  • Adobe 12001196 | Scripting Guide - Page 40
    page 44. Changes to scripts do not take effect until the scripts are re-run; you cannot make changes to a running script. TABLE 3.3 Scripts inside PDF files Location Document level Access Advanced > JavaScript > Document JavaScripts 40 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 41
    when you write scripts. Scripts Outside PDF Files Scripts outside of Acrobat are also listed in the Scripts window and are available for debugging in Acrobat. Table 3.4 lists these script types , you are currently stopped in the debugger. Each text Acrobat JavaScript Scripting Guide 41
  • Adobe 12001196 | Scripting Guide - Page 42
    3 Acrobat JavaScript Debugger Inspect Details Window entry represents a function call, or frame, in the stack. The text of an entry displays that can be created, edited, or deleted. Figure 3.7 identifies the Edit, New, and Delete buttons in the Details window. 42 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 43
    FIGURE 3.7 Inspect details window button controls Acrobat JavaScript Debugger 3 Inspect Details Window Edit New Delete Inspecting Variables The capability of . To contract the list again, click again on the triangle. FIGURE 3.8 Local variable details Acrobat JavaScript Scripting Guide 43
  • Adobe 12001196 | Scripting Guide - Page 44
    3 Acrobat JavaScript Debugger Inspect Details Window Watches The Watches list enables line, for example function callMe() { // curly brace is on a separate line var a = 0; } The Acrobat JavaScript debugger will not let you set a breakpoint next to the function name for Style 2. Attempting to set a
  • Adobe 12001196 | Scripting Guide - Page 45
    Acrobat JavaScript Debugger are debugging an iteration loop, for example, and your problem only occurs after the loop control variable reaches a certain where the breakpoint is set. By default, all breakpoints created in Acrobat have their conditions set to true. To change a breakpoint condition,
  • Adobe 12001196 | Scripting Guide - Page 46
    you are done using it. Otherwise it will continue to stop on every new script you execute in Acrobat. Click Interrupt Open the debugger window and click the Interrupt button. (It will display in red.) With you select Breakpoints from the Inspect drop-down list. 46 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 47
    do the following exercises, you must have unzipped the file TestDebugger.zip. to get the Calc.pdf file. In this exercise, you will set breakpoints in a script and create watches to view how to control how the interpreter executes the code in the script. Acrobat JavaScript Scripting Guide 47
  • Adobe 12001196 | Scripting Guide - Page 48
    10. For values less then 1, it multiplies the divisor 10. Say, for example, the user enters the values 2 and 4 consecutively. The code multiplies the 2 by 10 and adds 4 to the result. The point button Mouse Up action updates the divisor to 10 if it is 1. This 48 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 49
    10 to represent the tenths position. Testing the Calculator To familiarize yourself with the basic calculator operation, open Calc.pdf in Acrobat 3 to 9. Evaluate: 9 + 3 = ??? Results: 9 - 6 = -6 9 * 3 = 0 ((9 * 3) +3 )= 0 (((9 * 3) +3) = 0) + 3 = 3 9 + 3 = 3 Acrobat JavaScript Scripting Guide 49
  • Adobe 12001196 | Scripting Guide - Page 50
    value of entry to accum. Executing this statement does not update accum. See the watches in Figure 3.10. 9. You can either click Edit to correct the error or you can click Step Out to end the error in the editor and click Quit. 10.Clear the calculator display. 50 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 51
    FIGURE 3.10 The value of accum is not updated Acrobat JavaScript Debugger 3 Exercise: Calculator Another runtime error 1. Enter 9 + 3 = The result of evaluation is 3. . The value of entry should be added to accum. Correct the error: accum = accum + entry; Acrobat JavaScript Scripting Guide 51
  • Adobe 12001196 | Scripting Guide - Page 52
    script, both available for perusal and setting breakpoints via the debugger dialog. When trying to debug scripts at PDF file open time (e.g.: Doc-Level scripts) by turning on the "Debug From Start" menu item option in the halted doc-level script being debugged. 52 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 53
    Esc key is the last resort in case debugging of scripts causes the Acrobat application to hang. Summary The Acrobat JavaScript Debugger is a is a fully capable tool for troubleshooting problems in Acrobat JavaScript scripts. In combination with the Edit > Preferences dialog, the debugger enables you
  • Adobe 12001196 | Scripting Guide - Page 54
    3 Acrobat JavaScript Debugger Summary 54 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 55
    and create a text field. (For more information, see the section on Creating Form Fields in the Acrobat online help.) Select the General tab and name the field Today. 2. Select the Format tab, choose Document JavaScripts. Name the script Today, and click Add. Acrobat JavaScript Scripting Guide 55
  • Adobe 12001196 | Scripting Guide - Page 56
    Using Acrobat JavaScript field. (For more information, see the section on Creating Form Fields in the Acrobat online help.) Name this field ValueA with no spaces. 2. Click the Format field notation button, and then click Edit. 10.•In the JavaScript Editor window, type in the following text exactly as shown:
  • Adobe 12001196 | Scripting Guide - Page 57
    of each field object, as in the following example (equivalent to the symplified syntax in step 10, above): var f = this.getField("ValueA"); var g = this.getField("ValueB"); event.value information, see "Creating interactive buttons" in the Acrobat online help.) Acrobat JavaScript Scripting Guide 57
  • Adobe 12001196 | Scripting Guide - Page 58
    Acrobat button on your form that automatically mails the PDF document to a specified e-mail address when , see the section on Creating Form Fields in the Acrobat online help.) Name this field MailPDF. If you want "Creating interactive buttons" in the Acrobat online help.) 3. Click the Actions
  • Adobe 12001196 | Scripting Guide - Page 59
    Using Acrobat JavaScript in Forms 4 Creating simple JavaScripts 5. To mail the PDF document to the specified e-mail address when the button is selected, in the exact format, and click OK: var f = this.getField("GreaterThan"); f.hidden = (event.value < 100); Acrobat JavaScript Scripting Guide 59
  • Adobe 12001196 | Scripting Guide - Page 60
    field, link, bookmark, or page action, see the section in the Acrobat online help, "Adding Navigation to Adobe PDF Documents" > "Using Actions for special effects" > "About action types level JavaScript: 1. Choose Advanced > JavaScript > Document JavaScripts. 60 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 61
    a .js extension. 2. Copy the text file into the JavaScripts directory inside the Acrobat folder, or into the JavaScript folder in your system directory. Working with document level JavaScript Document Will Save runs the JavaScript while the document is saved. Acrobat JavaScript Scripting Guide 61
  • Adobe 12001196 | Scripting Guide - Page 62
    Acrobat editor's instructions. You will have to save your code and close the editor window before returning to Acrobat. The , click OK. Creating form fields programmatically Acrobat provides a large number of JavaScript properties and methods, organized following the Acrobat user interface (UI). If you
  • Adobe 12001196 | Scripting Guide - Page 63
    Acrobat through the Form toolbar in the Acrobat UI, or by the addField method section. In all of the Acrobat UI Field Properties dialogs, there . Note that in Acrobat 5, the form tool UI set its type to button. In Acrobat 6, instead of a single form Acrobat 5 UI, you cannot change
  • Adobe 12001196 | Scripting Guide - Page 64
    the General tab of the Properties dialog. It is possible through the UI in Acrobat to specify the Appearance of the field, its Options and its Actions, all of .ltGray; f.borderStyle = border.b; f.delay=false; this.setPageRotations(this.pageNum, this.pageNum); 64 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 65
    f.buttonPosition = position.iconOnly; f.hightlight = hightlight.p f.buttonScaleWhen = scaleHow.always f.buttonScaleHow = scaleHow.proportional buttonFitBounds = true; f.buttonAlignX = 50; f.buttonAlignY = 50; f.buttonSetIcon(i); f.buttonSetCaption("Push Me"); Acrobat JavaScript Scripting Guide 65
  • Adobe 12001196 | Scripting Guide - Page 66
    ; however, this assumes there is a named icon already in the PDF file. See the Doc Object addIcon for a complete example of inserting textFont. In the case of a check box, the font is always Adobe Pi. Options Tab The Options tab allows you to set the style of 66 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 67
    Using Acrobat JavaScript in Forms 4 Creating form fields programmatically Table Notes. ● Check box is checked by See Reference editable Example f.editable = true; doNotSpellCheck commitOnSelChange f.doNotSpellCheck = true; f.commitOnSelChange = true; Acrobat JavaScript Scripting Guide 67
  • Adobe 12001196 | Scripting Guide - Page 68
    Number AFNumber_Format() in Javascripts\aform.js Percentage Date AFPercent_Format() AFDate_FormatEx() Example f.setAction("Format", 'AFNumber_Format(2, 0, 0, 0, "\u20ac", true)'); f.setAction("Keystroke", 'AFNumber_Keystroke(2, 0, 0, 0, "\u20ac", true)'); 68 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 69
    Using Acrobat JavaScript in Forms 4 Creating form fields programmatically Region/Name See Reference Time AFTime_Format() Special Notes. ● Custom: Any validate script that does not use the AFRange_Validate() function is classified as custom. Acrobat JavaScript Scripting Guide 69
  • Adobe 12001196 | Scripting Guide - Page 70
    4 Using Acrobat JavaScript in Forms Creating form fields programmatically Calculate Tab The action of the combo box can be set with the field The Appearance tab shows the same set of properties as for buttons. For details, see the Appearance Tab for buttons. 70 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 71
    of the combo box. Radio Button A radio button field may be created either by the UI for Acrobat, or by the addField of the Doc Object. Unlike other form fields, a radio button requires multiple as for buttons. For details, see the General Tab for buttons. Acrobat JavaScript Scripting Guide 71
  • Adobe 12001196 | Scripting Guide - Page 72
    4 Using Acrobat JavaScript in Forms Creating form fields programmatically Appearance Tab The Appearance tab shows the same set of See Reference Example The default behavior, values null. setLock setLock oLock.action = "Include"; new Array ("mySignature") 72 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 73
    ", location: "San Jose, CA", reason: "I am approving this document", contactInfo: "[email protected]", appearance: "Fancy"}); ppklite.logout(); // choose handler // login // sign it // /Name Alignment See Reference alignment Example f.alignment = "center"; Acrobat JavaScript Scripting Guide 73
  • Adobe 12001196 | Scripting Guide - Page 74
    4 Using Acrobat JavaScript in Forms Creating form fields programmatically Region/Name See Reference Default Value defaultValue Multiline multiline Scroll long text the combo box. Calculate Tab The Calculate Tab tab is the same as that of the combo box. 74 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 75
    buttons and menu items (see the hideMenuItem and hideToolbarButton). Document level By using the Adobe Acrobat menu item Advanced > JavaScript > Document JavaScripts..., you can add, modify, or . Document level scripts are stored 1. Frequently Asked Questions Acrobat JavaScript Scripting Guide 75
  • Adobe 12001196 | Scripting Guide - Page 76
    level and field level scripts are stored within the PDF document and therefore the forms programmer should make every flat hierarchy of names is sufficient and works well. The problem with using flat names is that there is no association between = color.yellow; 76 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 77
    Acrobat discusses the use of Date objects within Acrobat. The reader should be familiar with the JavaScript Date getFullYear(); Converting from a Date to a String Acrobat Forms provides several date related methods in addition strings. Because of Acrobat Forms' ability to handle dates in
  • Adobe 12001196 | Scripting Guide - Page 78
    A A Short Acrobat JavaScript FAQ How do I use date objects? To convert a Date object into a string, the printd of the Util Object is used. we've learned from Y2K coding issues, it is advised that you output dates with a four digit year to avoid ambiguity. 78 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 79
    A Short Acrobat JavaScript FAQ A How do I use date objects? Converting from a string to a date To convert a string into a Date object the to do this. The simplest and possibly most easily understood method is by manipulating dates in terms of their numeric Acrobat JavaScript Scripting Guide 79
  • Adobe 12001196 | Scripting Guide - Page 80
    A A Short Acrobat JavaScript FAQ How do I use date objects? representation. Internally, JavaScript dates are stored as the number of milliseconds (one thousand script would look something like: It is currently: 01/15/1999 In 13 days, it will be: 01/28/1999 80 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 81
    period. The ability to set a user password is accessed by choosing File > Document Properties... from the Acrobat menu, then select Security from the left-hand pane. From the drop down menu, select Password Security. form has not been tampered with and is thus Acrobat JavaScript Scripting Guide 81
  • Adobe 12001196 | Scripting Guide - Page 82
    PDF document containing the restricted JavaScript methods using the digital ID. For details on where you can obtain digital IDs and the procedures for using them to sign documents, see "Creating a certifying signature" in Adobe Acrobat 's value is set to null). 82 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 83
    4.05 release of Acrobat, Adobe has worked to allow motion and vision impaired users to fill out Acrobat Forms. Version 6 of Acrobat is more fully "IRS1040.pdf" a good document title would be "Form 1040: U.S. Individual Income Tax Return for 1998". In addition, third-party screen readers usually read
  • Adobe 12001196 | Scripting Guide - Page 84
    the tab order on the current page to become active. If there are no form fields on the page then Acrobat will inform the user of this via a speech cue. Using tab (shift-tab) while a field has they are in a document, will now be able to reference this variable. 84 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 85
    A Short Acrobat JavaScript FAQ A How can I send form data to an e-mail address? Making Globals opened) that defines a global field value of interest: function PublishValue( xyzForm_fieldValue_of_interest ) { global.xyz_value = xyzForm_fieldValue_of_interest; } Acrobat JavaScript Scripting Guide 85
  • Adobe 12001196 | Scripting Guide - Page 86
    popUpMenu(arrayName) from the mouse-down or mouse-up event of a given field to pop the menu. For Acrobat 6.0, you can also use the app.popUpMenuEx() method. Example: var cChoice = app.popUpMenu("one", "two", color-space type and channel values you want to use. 86 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 87
    specified URL over the internet using a GET. If the current document is being viewed inside the browser or Acrobat Web Capture is not available, it uses the Weblink plug-in to retrieve the requested URL. How can , so 73% is specified as 73 and not as 0.73. Acrobat JavaScript Scripting Guide 87
  • Adobe 12001196 | Scripting Guide - Page 88
    A A Short Acrobat JavaScript FAQ How can I determine if the mouse has entered/left a certain area? How can I determine if the mouse has entered/left detect mouse entry or exit. Then attach JavaScripts to the mouse-enter and/or mouse-exit actions of the field. 88 Acrobat JavaScript Scripting Guide
  • Adobe 12001196 | Scripting Guide - Page 89
    applications 15 plug-in 12 Acrobat Database Connectivity. See ADBC actions JavaScript 60 setting options 58 with JavaScript 58 ADBC See also ADBC object ADBC object 17 See also ADBC Advanced
  • Adobe 12001196 | Scripting Guide - Page 90
    simplified field 56 O object hierarchies 15 objects See also JavaScript objects online team review 12 P PDF documents. See documents permanent data 16 persistent data 16 plug-in level JavaScript 7, 60, 61 17 utility routines 15 V validating, with JavaScript 59 Acrobat JavaScript Scripting Guide
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90

ADOBE SYSTEMS INCORPORATED
Corporate Headquarters
345 Park Avenue
San Jose, CA 95110-2704
(408) 536-6000
b
c
May 2003
Acrobat JavaScript
Scripting Guide
Technical Note #5430
Version: Acrobat 6.0