6 Replies Latest reply on Jul 24, 2014 4:14 PM by GibsonMcqueen

    Untick "Scroll Long Text" in all forms in a doc using JS

    GibsonMcqueen

      I am new to JS and it's been years since I did any basics programming (by basic I very much mean BASIC). I work for a training company and am currently making our assessments electronic. This involves creating large (some up to 100 pages) documents that have multiple forms on each page. Current document I'm working on has around 900 forms. Using the auto wizard function to create the forms, the default properties are Auto text size and "Scroll Long text" is always ticked with "Multiple lines" unticked. I want to create a JS that I can run that will change the font size to be a fixed size; untick the "Scroll Long Text" and preferably tick "Multiple Lines" (though acrobat pro seems to do a good job of doing the last part it self for the most part).

       

      I have been working for about 3 hours and finally managed to get the first bit to work. My code to change the font size is:\

       

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      var newTextSize = 8

      for(var i=0;i < this.numFields;i++)
      {
      var fNm = this.getNthFieldName(i);
      this.getField(fNm).textSize = newTextSize
      console.println(i+":"+
      this.getField(fNm).textSize);

      }

       

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      Last bit is just a check. It works to convert the textsize great. But I'm stuck on how to tick/untick the boxes and any help would be very much appreciated.

       

      I use Adobe Acrobat Pro XI and as mentioned before, the code above is the first thing I've ever tried with JS and most of that was bumbling around through other things I found on the net till I eventually got something that worked so if there is some in depth stuff I might need to ask extra questions.

       

      Thanks for the help guys,