Other PDF Issues

Run Acrobat JavaScript from Another Script: Fix the Undefined app Error

Aamir Naveed AkramAamir Naveed Akram Nov 18, 2026 868 views

Question details

The user wants to run Acrobat's sdkAddSignature.js from another JavaScript file without displaying Acrobat.

How to Run Acrobat JavaScript from Another Script
Product
Adobe Acrobat JavaScript SDK
Device & OS
not provided
Scenario
An external JavaScript file attempts to call an Acrobat application-level script to add a signature.
Observed behavior
The external script reports that app is undefined because the Acrobat JavaScript object is not available in its runtime.
Before you start

Open Acrobat and the PDF you want to work with, and check the SDK documentation for the functions and permissions required by sdkAddSignature.js. Make sure Acrobat JavaScript is enabled in Acrobat's preferences.

Solution 1Recommended

Call the SDK functions inside Acrobat

Use Acrobat's JavaScript environment instead of executing the application-level file in an external JavaScript runtime.

The app object belongs to Acrobat's JavaScript engine; it is not available in a general-purpose JavaScript runtime. Acrobat must be running and the target document open for this workflow.

The SDK functions may require a folder-level script or another trusted context. Follow the SDK's instructions and Acrobat's security requirements rather than assuming every function can run from a document script.

1
Check JavaScript preferences

In Acrobat, open Preferences and select JavaScript. Enable Acrobat JavaScript if it is disabled.

2
Load the required functions

Follow the Acrobat SDK instructions to install the required functions as a folder-level script or place suitable code in an Acrobat document script. Restart Acrobat if you install a folder-level script.

3
Open the target PDF

In Acrobat, select File > Open and open the PDF to be signed.

4
Invoke the documented function

Use Acrobat's JavaScript console or an appropriate Acrobat document script to call the function specified by the SDK, with its required arguments and security context.

Call the SDK functions inside Acrobat
Headless execution is not supported by this approach: Running the file directly from external JavaScript will not provide Acrobat's app object. This workflow requires Acrobat and an open document; it does not guarantee execution without displaying Acrobat or security prompts.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its format compatibility helps you move existing files into WPS, but it does not run Acrobat SDK JavaScript or fix Acrobat's app object.

Open and review PDF documents in the same office suiteCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for working with existing Office filesFree, lightweight option for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Why is app undefined when I run the script externally?

The app object is provided by Acrobat's JavaScript engine. An external JavaScript runtime does not have that object, so the SDK file cannot be called directly there.

Can I run sdkAddSignature.js without opening Acrobat?

Not by calling the application-level file from external JavaScript. This Acrobat JavaScript workflow requires Acrobat to be running and the target document to be open.

Where should I put the Acrobat JavaScript functions?

Depending on the SDK's requirements, use an Acrobat folder-level script, a document script, or another appropriate trusted Acrobat JavaScript context. Check the SDK documentation for the function's installation and security requirements.

How do I enable JavaScript in Acrobat?

Open Acrobat Preferences, select JavaScript, and enable Acrobat JavaScript. Some functions may still require additional trust or permissions.

Can WPS Office execute Acrobat SDK JavaScript?

WPS Office can open PDF and Microsoft Office files, but it does not provide the Acrobat JavaScript engine needed to run Acrobat SDK scripts.