1 Reply Latest reply on Jul 10, 2009 1:03 PM by gkaiseril

    newbie Acrobat scripting questions

    Michael Mendelsohn

      Hi list…

       

      I’m doing my first ever scripting in Acrobat, and enjoying it.  A few probably simple questions:

       

      1. Is there a technique for getting the reference to an OCG (layer) by name similar to how this.getField is implemented?  There doesn’t seem to be a method for it.

       

      2. E4X doesn’t seem to have a length property.  Am I right about that?

       

      3. Regarding this.getPageBox(), where is 0,0 on the page?  Upper left?  I can’t seem to create a “marquee” to get the two fields I want to get with th oCoords parameter. 

       

      4. Any methodology to the way this.getLinks() orders the array of links it returns?  It seems the bottom links on the page are first in the array, and I sort of expected the opposite to be true.

       

      5. I have this mysterious yellow highlighted combobox and can’t get rid of the highlighting.  Anyone know how?

       

      Thanks!!

      - Michael M.

        • 1. Re: newbie Acrobat scripting questions
          gkaiseril MVP & Adobe Community Professional

          > 1. Is there a technique for getting the reference to an OCG (layer) by name similar to how this.getField is implemented?  There doesn't seem to be a method for it.

           

          You need to use the 'OCG' object, an array of the OCG layers. You need to use the 'doc' objects 'getOCGs()' method to get the array of OCGs.


          > 2. E4X doesn't seem to have a length property.  Am I right about that?

           

          If 'E4X' is a numeric field you will need to use the 'valueAsString' property or the 'toString()' method to convert the number to a character string.


          > 3. Regarding this.getPageBox(), where is 0,0 on the page?  Upper left?  I can't seem to create a “marquee” to get the two fields I want to get with the oCoords parameter.

           

          It is located at the lower left corner. See Automating Placement of Annotations by Thom Parker for information about the coordinates and how to use the little documented 'Matrix2D' object for transforming the quads as needed.

          http://www.acrobatusers.com/tutorials/2007/10/auto_placement_annotations


          > 4. Any methodology to the way this.getLinks() orders the array of links it returns?  It seems the bottom links on the page are first in the array, and I sort of expected the opposite to be true.

           

          That is because the page is based from the lower left corner.

           

          > 5. I have this mysterious yellow highlighted combo box and can't get rid of the highlighting.  Anyone know how?

           

          Have you set the application's preference ("Edit => Preferences => Forms") for highlighting required form fields?

           

          You might want to download the SDK and JavaScript documentation from the Adobe Acrobat Development Center.

          http://www.adobe.com/devnet/acrobat/