Skip to main content
Participant
August 10, 2020
Answered

PDF javascript not working on Mobile - Android/ iOs

  • August 10, 2020
  • 3 replies
  • 8408 views

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

This topic has been closed for replies.
Correct answer Bernd Alheit

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

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

3 replies

Participant
February 22, 2021

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

Participant
May 11, 2021

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;
}

try67
Community Expert
Community Expert
August 10, 2020

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

ec899Author
Participant
August 11, 2020

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

Bernd Alheit
Community Expert
Community Expert
August 10, 2020

How does you populate the dropdown?

ec899Author
Participant
August 10, 2020

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;    
.
.
.
.
.
}

 

 

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
August 10, 2020

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

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