Copy link to clipboard
Copied
Hi,
My PDF has a Form field, which gets populated with the current using below document script.
var f = this.getField("Today"); f.value = util.printd("mm/dd/yyyy", new Date());
It works fine in our desktop version of the Acrobat reader. However this script is not running in Samsung Galaxy S4.
From the other posts, I understand that acrobat javascript has limited/no support on android.
Please advise the possible next steps?
1. Does any specific version of android operating system or any specific version of acrobat reader will support this script execution?
2. What are the potential alternatives to set the date field to current date in PDF without using acrobat javascript?
Copy link to clipboard
Copied
Are you using the Adobe Reader for Android? That script should work assuming you have it in the right place. Where is the Javascript running from?
Copy link to clipboard
Copied
Yes I'm using Adobe Reader for Android only.
I'm not sure what exactly you meant by right place.
One correction to my question is that the field I'm quoting is not the FormField, it is the normal field. I'm not sure whether that will make any difference.
Copy link to clipboard
Copied
Your code accesses a from field that may have the read only property so only a script action can update the field.
Copy link to clipboard
Copied
But the field is getting updated in Desktop version of acrobat reader, not in the mobile version.
Copy link to clipboard
Copied
Where is the JavaScript running from? A field? If so, what action? From a document level script? We need more details.
Copy link to clipboard
Copied
Ok. Yes, This is a document level script, not the field level
Copy link to clipboard
Copied
Ah.. ok... You're going to want to move that script to a hidden text field on the form. Document-level scripts seem to run on iOS but I've never seen one run on Android.