1 Reply Latest reply on Nov 27, 2013 11:00 PM by George_Johnson

    How to get x and Y co ordinates of a button?

    MaheshVarmaSanga

      I created 100 buttons in my pdf form and I want to get the co-ordinates of the button on which the user pressed  Is there any way we can do using acrobat javascript?

      I tried the following code but did not get the co-ordinates.

       

       

      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(word, "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);

                                    oFld.setAction("MouseUp", "setPoleProperties(\"" + oFld.name

                                                        + ",\""+fldRect[0]+",\""+fldRect[1]+"\");");

                                    console.println(fldRect[0],","+fldRect[1]);

                          }