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

PDF javascript not working on Mobile - Android/ iOs

New Here ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

Hello,

I have created a dyanmic dropdown in Adobe Acrobat Pro DC. 
Dropdown selection determines the selections in another dropdown. This is working fine in desktop but when tested in mobile device - iOS/Android, nothing happens. Dropdown2 doesn't get populated.

Do you guys have any idea?

Javascript code is a simple switch statement.

 

Thanks,

EC

TOPICS
Android , iOS , PDF forms

Views

6.3K

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
1 ACCEPTED SOLUTION
Community Expert ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

The method setItems is not available in Acrobat Reader for Android or iOS:

https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/js.html 

View solution in original post

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

How does you populate the dropdown?

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

Hi Bernd,

 

I use a simple switch statement which I placed under Custom Keystroke Script.

 

 

switch (event.change) {
    
        case "SELECT YOUR CITY":
            this.getField("Street").setItems(["SELECT YOUR STREET"]);
            break;    
		case "NEW YORK":
            this.getField("Street").setItems(["SELECT YOUR STREET","STREET 1", "STREET 2"]);
            break;    
		case "CHICAGO":
            this.getField("Street").setItems(["SELECT YOUR STREET","STREET 3", "STREET 4"]);
            break;    
.
.
.
.
.
}

 

 

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

The method setItems is not available in Acrobat Reader for Android or iOS:

https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/js.html 

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

Thanks for that Bernd.

 

Does that mean I should use resetForm?

this.getField("Street").resetForm(["SELECT YOUR STREET","STREET 3", "STREET 4"]);

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

With resetForm you can only reset fields to default values.

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

Thank you. That means no other way to achieve this in mobile devices, right?

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

Do not count on any scripts working in Adobe Reader Mobile, unfortunately. Your best chance is using PDF Expert by Readdle on iOS devices.

Votes

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 ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

that's bad news. I need it to work on both iOS and Android

Votes

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 ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

There is a "Foxit PDF reader" on android. It can read pdf with scripts

Votes

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 ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

LATEST

Foxit PDF Reader works for me , many thanks for that suggestion.

 

Have the following JS to change the colour of a field depending on the value.  Works well on PC, but won't work on in Adobe Reader on Android

 

var pres=this.getField("pressure").value;
var total=0;
var partial=0;

if (pres<101)
{
this.getField("result").value="FAIL";
this.getField("result").fillColor=color.red;
total=total+10
}
else if (pres>111)
{
this.getField("result").value="FAIL";
this.getField("result").fillColor=color.red;
total=total+10
}
else if (pres>=101 && pres<=111)
{
this.getField("result").value="PASS";
this.getField("result").fillColor=color.green;
}

Votes

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