Other PDF Issues

How to Use the Acrobat JavaScript Console and Debugger

Nimra MalikNimra Malik Nov 3, 2026 869 views

Question details

The user needs to learn how to monitor variables, debug custom functions, and utilize the built-in JavaScript console and debugger in Adobe Acrobat.

How to Use the Acrobat JavaScript Console and Debugger
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Debugging custom JavaScript code and monitoring variables within a PDF document or form.
Observed behavior
The user is encountering undefined function errors and needs to successfully open the console, set breakpoints, and inspect variables during script execution.
Before you start

Ensure that JavaScript and the JavaScript Debugger are explicitly enabled in your Adobe Acrobat preferences (Edit > Preferences > JavaScript) and that you have restarted the application.

Solution 1Recommended

Accessing the JavaScript Console to Monitor Variables

Open the built-in JavaScript console to run code snippets, print variable values, and identify undefined functions.

The JavaScript console is an interactive environment where you can test scripts and monitor outputs in real-time. It is essential for troubleshooting issues like undefined functions.

1
Open the console

Press Ctrl+J on Windows or Command+J on macOS to launch the Acrobat JavaScript Console.

2
Define functions correctly

Ensure any custom functions (like callMe) are defined in your script before they are invoked to prevent 'undefined' errors.

3
Print variable values

Use the command console.println(variableName) within your script to output and track variable states directly in the console.

4
Check script context

Verify that your code is placed in the correct context (e.g., document level, specific form field, or console script) and that properties like event.value are available there.

Accessing the JavaScript Console to Monitor Variables
Context Availability: Acrobat JavaScript objects behave differently depending on where the script is executed. Always verify your script's scope.
Free Microsoft Office alternative

Switch to WPS Office for a Streamlined PDF Experience

While Adobe Acrobat offers advanced developer tools for JavaScript debugging, WPS Office provides a lightweight, highly compatible, and user-friendly PDF editor. Easily edit text, manage pages, and fill forms without complex scripting or expensive subscriptions.

Seamlessly read, edit, and convert PDF documentsHighly compatible with Microsoft Office and Adobe PDF formatsLightweight software with a fast and familiar user interfaceCost-effective alternative to expensive PDF editing software
microsoft office alternative - wps office

Frequently Asked Questions

Why is Acrobat reporting that my JavaScript function is undefined?

This error typically occurs if the function is called before it is defined, or if it is defined in a scope (like a different document level or field) that is not accessible to the calling script. Ensure your function is defined globally or prior to invocation.

How do I view output from console.println in Acrobat?

You can view the output by opening the JavaScript Console. Press Ctrl+J on Windows or Command+J on macOS to open the console window and review your printed debug messages.

Does WPS PDF support JavaScript console debugging?

WPS PDF supports robust PDF viewing, form filling, and editing capabilities. However, for specialized backend developer tasks like advanced JavaScript debugging and real-time console execution, dedicated developer tools found in Acrobat Pro are required.