Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Running Document JavaScript in Android

New Here ,
Jun 10, 2019 Jun 10, 2019

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?

TOPICS
Acrobat SDK and JavaScript
707
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2019 Jun 11, 2019

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 12, 2019 Jun 12, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 12, 2019 Jun 12, 2019

Your code accesses a from field that may have the read only property so only a script action can update the field.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 12, 2019 Jun 12, 2019

But the field is getting updated in Desktop version of acrobat reader, not in the mobile version.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2019 Jun 13, 2019

Where is the JavaScript running from? A field? If so, what action? From a document level script? We need more details.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 13, 2019 Jun 13, 2019

Ok. Yes, This is a document level script, not the field level

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2019 Jun 17, 2019
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines