Copy link to clipboard
Copied
i add some java script code in my program but in my pc work perfect, when i move this in mobile iOS app javascript code not working! Why??
Copy link to clipboard
Copied
How much JavaScript - or if it's supported at all - depends on what PDF viewer you are using on your mobile device. Even Adobe's own Reader has only very limited support for JavaScript. The default PDF viewer on iOS does not support JavaScript (and many other features you often find in PDF files) not at all. Take a look here for information about what's supported in Adobe's mobile Reader:
JavaScript APIs and Forms — Enterprise Guide for Acrobat on Mobile Devices
Copy link to clipboard
Copied
Karl, I'm not sure you will see this as it is month after the original post, but I'm running into the same problem. according to the mobile API reference, I believe that my basic code should work. Its just a button that has the code as following:
this.getField("number").value = "01"
It seems that the API reference is not accurate. I have tried my same code in multiple different mobile pdf readers, on both android and apple.
Copy link to clipboard
Copied
The API Reference is accurate. It's specific to the Adobe viewers, not PDF in general.
Most mobile PDF viewers don't support JavaScript at all. I've tested the code you show above and it does run on the Adobe Reader on iOS and Android and PDF Expert by Readdle on iOS but that's about it.
Copy link to clipboard
Copied
Could the implementation of the code be the problem? I have it as a button that writes to the empty text field. It works just fine on a desktop version but when I open it up on the android version of adobe reader, the button does nothing. Could it be that buttons aren't supported on the mobile adobe reader?
Copy link to clipboard
Copied
I only tested on iOS. It might be a bug but the documentation is accurate.
Copy link to clipboard
Copied
Could you send me the document that you tested on an iOS device? I would like to test it out on my android to see if it is an issue with my implementation or if it is an issue with the android version of adobe reader. Hopefully I just screwed something up and can learn from the document you made.
Copy link to clipboard
Copied
Here you go. The JavaScript is in the MouseUp action of the button.
Link to MobileTestCode.pdf