Posts tagged "debugger"

How to enable the Javascript debugger in Adobe Reader

Using the debugger with Adobe Reader

 The JavaScript Debugger is normally accessed from the Acrobat Pro user interface, but it can also be triggered to appear in Adobe Reader when an exception occurs.  Though fully supported JavaScript debugging is only available in Acrobat Pro, the following instructions make the complete Debugger functionality available in Adobe Reader on Windows and Mac OS platforms.

For Windows, note that this procedure involves editing the registry. Adobe Systems Incorporated does not provide support for editing the registry, which contains critical system and application information. It is recommended that you back up the registry before modifying it.

  1. Get a copy of the file debugger.js from an installation of Acrobat (plugins folder), the Acrobat Developer Center, or from the SDK (Acrobat 9.0 SDK/JavaScriptSupport/Debugger/debugger.js)
  2. Copy the debugger.js into the Reader 9.0/Reader/JavaScripts folder.
  3. Create key/value pairs in the registry settings, starting at the location HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\9.0\JSPrefs\ on Windows as shown in the table below, or in the property list file :Library:Preferences:com.adobe.Reader9.0.plist on Mac OS.

For Mac OS, use an appropriate editor for the property list file, and add the following children under JSPrefs, using Type “Array” in each case: ConsoleOpen, ConsoleInput, EnableDebugger, and Exceptions. Under each of these children, add the following children: 0 (number) and 1 (boolean).

bConsoleInput REG_DWORD 0×00000001
bEnableDebugger REG_DWORD 0×00000001
iExceptions REG_DWORD 0×00000002
(This will break into the Debugger when exceptions occur.)

4. Close and restart Adobe Reader. At this point the Javascript Debugger will be available.

Note: Since Adobe Reader does not provide access to the Debugger through its menu items or the Ctrl + J key sequence, the only ways to access the Debugger are to execute a JavaScript, cause an error, or customize the user interface (for example, you could add a button that runs a JavaScript causing the Debugger to appear).

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 9.5/10 (2 votes cast)

Acrobat/Reader: how to enable Javascript debugger in PDF forms

When you use Javascript in PDF forms, you can enable the Javascript debugger to be able to analyze the Javascript output in Acrobat or Designer.

Use the following approaches to enable Javascript debugging using Acrobat or Designer:

  • Use message box output to display dialog boxes with Javascript values (using the xfa.host.messagebox method).
  • Use the Javascript Debugger console in Acrobat. Open it by pressing Ctrl+J or select
    Edit > Preferences > Javascript > Javascript Debugger > Enable Javascript Debugger
    Restart Acrobat to view the Debugger console when using the Preferences option.
  • From Designer, save the form as PDF, open it in Acrobat, and press CTRL+J to open the debugger.
  • Launch Acrobat in the background, open the form in Designer, and goto PDF Preview. This approach uses the Acrobat plug-in, from where pressing Ctrl+J calls up the Javascript debugger.

To execute Javascript expressions directly in the console window, enter the statement and highlight the entire statement using the cursor. (Optionally, highlight multiple lines to execute multiple lines of Javascript code.) Press Ctrl+Enter.

reference: (180009803)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 7.6/10 (5 votes cast)