Fix Adobe Reader Crashing When Reopening the Same PDF via JavaScript
Question details
The user is experiencing application crashes in Adobe Reader DC on Windows 10 when using a JavaScript command to reopen a recently closed PDF file with the same name.

- Product
- Adobe Reader DC
- Device & OS
- Windows 10
- Scenario
- Executing a JavaScript command (app.openDoc) to reopen a PDF file that was just closed.
- Observed behavior
- Adobe Reader DC stops responding and freezes, whereas the exact same JavaScript code executes successfully in Acrobat Pro.
Before attempting to modify your document scripts, ensure you have saved backups of your PDF files and updated Adobe Reader DC to the latest version via Help > Check for Updates to rule out patched vulnerabilities.
Modify the JavaScript to Avoid Reopening the Same Instance
Since this is a known limitation in Adobe Reader DC, the most effective workaround is adjusting your JavaScript code to prevent calling the exact same file name immediately.
Adobe Reader DC has inherent restrictions with the app.openDoc method compared to Acrobat Pro. Calling a recently closed file triggers a hang in the application's engine.
Open your PDF authoring software, navigate to the 'Prepare Form' or 'JavaScript' tool, and locate the document-level script containing the app.openDoc function.
Add an 'if' statement in your script logic to verify whether the document is already open, or assign a setTimeout delay before attempting to reopen the file.
If your workflow requires continuous reopening, configure the script to duplicate the file temporarily so that the application opens a PDF with a different file name instead.

Upgrade to Adobe Acrobat Pro
Because the freezing issue is isolated to the free Adobe Reader DC, using Adobe Acrobat Pro completely avoids the JavaScript handling bug.
Manage and Edit PDF Files Seamlessly with WPS Office
Avoid script-related crashes and limitations by managing your documents with WPS PDF. WPS Office offers a lightweight, fast, and stable environment for viewing, editing, and managing your PDF documents, acting as a reliable alternative to bloaty PDF readers.
- 1. Download WPS Office: Visit the official WPS website to download and install the WPS Office suite for free.
- 2. Open WPS PDF: Launch the application and click on the 'PDF' tab from the main dashboard.
- 3. Load your document: Click the 'Open' button to browse your computer directories and load the problematic PDF file.
- 4. Edit and manage: Use the built-in toolbar options to read, edit, annotate, or convert your PDF without performance interruptions.

Frequently Asked Questions
Why does Adobe Reader freeze when my JavaScript runs?
Adobe Reader DC has known bugs related to certain JavaScript methods, specifically `app.openDoc`. When it attempts to reopen a document that was just closed via scripts, the software's document handling engine stops responding.
Can I fix the `app.openDoc` freezing issue without buying Acrobat Pro?
You cannot patch the core bug directly in Reader DC, but you can work around it by editing your JavaScript code to avoid calling the exact same file immediately after closing it.
Does this PDF JavaScript bug affect Mac users as well?
While this specific report highlights Windows 10, JavaScript handling limitations in Adobe Reader DC are generally cross-platform and tied to the software's engine capabilities rather than the operating system itself.




