Fix PDF Date JavaScript Not Working in Adobe Reader
Question details
User has a PDF form containing a JavaScript that automatically inserts the current date. This script functions correctly when opened in Acrobat DC on a Mac, but fails to execute when the PDF is viewed in Adobe Reader on a different computer.

- Product
- Adobe Acrobat DC / Adobe Reader
- Device & OS
- Mac / Other OS
- Scenario
- Using a JavaScript to automatically fill a specific form field with the current date when opening or viewing a PDF document.
- Observed behavior
- The date script runs successfully in the full version of Acrobat DC, but it does not trigger or populate the date field when the document is opened in Adobe Reader.
Ensure you have the latest version of Adobe Reader installed on the target computer, and verify that the target date form field is not set to 'Read Only' in the original document properties.
Enable JavaScript and Check Security Settings in Adobe Reader
Adobe Reader might have JavaScript disabled by default or blocked by security features like Protected Mode.
By default, Adobe Reader on some computers may restrict JavaScript execution to prevent malicious code from running. Adjusting the Preferences can resolve this issue without altering the PDF itself.
Launch Adobe Reader on the computer where the script is failing. Go to 'Edit' > 'Preferences' (Windows) or 'Acrobat Reader' > 'Preferences' (Mac).
Select the 'JavaScript' category from the left sidebar. Check the box next to 'Enable Acrobat JavaScript' and ensure execution privileges are granted.
Navigate to the 'Security (Enhanced)' category in Preferences. If the issue persists, temporarily uncheck 'Enable Protected Mode at startup' to see if sandboxing is blocking the script. Restart Adobe Reader and open the PDF again.

Move Date Code to a Document-Level Script
Page-open triggers for JavaScript are sometimes ignored in Reader; document-level scripts initialize more reliably.
Try WPS Office for Easy PDF and Document Management
If complex JavaScript configurations in Adobe Reader are causing workflow issues, try WPS Office. It's a comprehensive, lightweight suite that handles PDFs, Word, Excel, and PowerPoint files natively. It simplifies adding dates, filling forms, and editing PDFs without needing advanced script troubleshooting.
- 1. Download WPS Office: Visit the official WPS website and download the free version for your Mac or PC.
- 2. Open Your PDF: Launch WPS Office and click 'Open' to load your PDF document or form.
- 3. Fill and Edit: Use the 'Fill & Sign' or 'Edit PDF' tools to easily insert dates, text, and signatures without writing code.

Frequently Asked Questions
Why does my PDF JavaScript work in Acrobat but not in Reader?
Acrobat DC is a full authoring tool with elevated privileges, whereas Adobe Reader restricts certain JavaScript executions for security reasons. Additionally, Reader may have JavaScript disabled by default or blocked by its 'Protected Mode' sandbox.
How do I add an automatic date to a PDF without using JavaScript?
Without JavaScript, you cannot dynamically populate the current date when a PDF is opened. However, you can use standard PDF editing software to manually insert a date stamp or use a 'Fill & Sign' text box before saving the document.
Are document-level scripts better than page-action scripts in PDFs?
Yes, for initialization tasks like setting the current date. Document-level scripts run as soon as the PDF is loaded, while page-action scripts (like 'Page Open') can be inconsistent, bypassed, or blocked depending on the PDF viewer configuration.
Can Protected Mode in Adobe Reader break PDF forms?
Yes. Protected Mode runs Adobe Reader in a restricted environment to protect your computer. This sandbox can block complex JavaScript from executing properly, preventing automated form fields and calculations from functioning.




