Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Re: unable to get the clicked button value

$
0
0

The definition statement is missed from the above snippet.

 

Updated script is below:

 

var numWords = this.getPageNumWords(0);

 

for ( var j = 0; j < numWords ; j++) {

          var nThWord;

          var cScript;

          nThWord= this.getPageNthWord(0, j);

          var wrdRect = this.getPageNthWordQuads(0, j);

          if (nThWord != '') {

 

                    cScript = "app.alert(oFld.name);";

 

                    app.alert(cScript);

                    console.println(nThWord);

                    var fldRect = [];

                    fldRect[0] = wrdRect[0][4];

                    fldRect[1] = wrdRect[0][5];

                    fldRect[2] = wrdRect[0][4] + 3;

                    fldRect[3] = wrdRect[0][5] + 3;

                    var oFld = this.addField(nThWord, "button", 0, fldRect);

                    if (oFld != null) {

                              oFld.buttonSetCaption("");

                              oFld.borderStyle = border.s;

                              oFld.fillColor = color.gray;

                              oFld.textColor = color.white;

                              oFld.lineWidth = 1;

                              oFld.setAction("MouseUp", cScript);

                    }

          }

}


Viewing all articles
Browse latest Browse all 10848

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>