Other PDF Issues

Fix an Acrobat Add PDF Button That Does Not Open a File Picker

Steve KSteve K Nov 25, 2026 868 views

Question details

The user needs an Acrobat JavaScript dialog's Add PDF button to open a file picker and attach a selected PDF.

Fix an Acrobat Add PDF Button That Does Not Open a File Picker
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A custom Acrobat JavaScript dialog includes a button for selecting and attaching a PDF.
Observed behavior
Clicking Add PDF does not open a file selection dialog.
Before you start

Open the PDF and the JavaScript code that defines the dialog in Acrobat. Check Acrobat's JavaScript preferences and note any error displayed when you click Add PDF.

Solution 1Recommended

Isolate the Acrobat button, file picker, and attachment code

Use this approach to identify which part of the dialog workflow prevents the file picker or attachment from working.

1
Check for JavaScript errors

Open Acrobat's JavaScript console with Ctrl+J on Windows or Command+J on macOS, then click Add PDF and review any messages in the console.

2
Verify the button event

Inspect the dialog definition and its Add PDF event handler. Add a temporary console.println() message to the handler, reopen the dialog, and click the button to see whether the message appears.

3
Test the file picker separately

In the JavaScript console, test app.browseForDoc() independently of the dialog and attachment code. Check whether a file picker opens or Acrobat reports an error.

4
Test attachment creation separately

Once file selection works, test the attachment or annotation creation code independently with a known PDF. Check the console for errors and confirm the selected file information is passed to that code.

5
Reconnect the workflow

Place the working selection and attachment code in the appropriate button event handler, reopen the dialog, and click Add PDF to test the complete workflow.

Isolate the Acrobat button, file picker, and attachment code
Check the execution context: Acrobat JavaScript methods can have security and execution-context restrictions. If the console test works but the dialog handler does not, review the error and Acrobat's JavaScript documentation for the method and event context.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative for everyday PDF and Office work, with a familiar interface and support for common Microsoft Office formats to ease migration. It does not fix Acrobat-specific JavaScript dialog or button errors.

Open and read PDF documents alongside your Office filesCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for everyday document workFree and lightweight for common productivity tasks
microsoft office alternative - wps office

Frequently Asked Questions

How can I tell whether the Add PDF button event is firing?

Add a temporary console.println() statement to the button's event handler, open the JavaScript console, and click Add PDF. If the message does not appear, inspect the dialog's button event definition.

What should I do if app.browseForDoc() works in the console but not in the dialog?

Check the console for errors after clicking the button, then review the handler and the execution-context and security requirements for app.browseForDoc() in Acrobat's JavaScript documentation.

Why test attachment creation separately from file selection?

A separate test helps determine whether the problem is opening the picker, passing the selected file information, or creating the attachment or annotation. Review the JavaScript console after each test.

Can WPS Office repair an Acrobat JavaScript button?

No. The button and its JavaScript run in Acrobat, so troubleshoot them in Acrobat. WPS Office can be used separately for everyday PDF and Office document work.