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

Running Document JavaScript in Android

New Here ,
Jun 10, 2019 Jun 10, 2019

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?

TOPICS
Acrobat SDK and JavaScript

Views

203

Likes

Translate

Translate

Report

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

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?

Likes

Translate

Translate

Report

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

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.

Likes

Translate

Translate

Report

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

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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