2 Replies Latest reply on Sep 23, 2015 7:20 AM by aao81880951

    Help with Javascript syntax for dynamic header / footer...


      Hello -


      I'm brand new to JavaScript but I was able to frankenstein two snippets of code that work well individually, but I can't figure out how to get them to run together. I'm trying to apply both a dynamic header and footer to a large number of documents using Batch Processing. Here are the two snippets that work and if anyone could help me combine them, I'd be very thankful!


      for (var pageNumber = 0; pageNumber < this.numPages; pageNumber++) { var DateStamp = this.addField("DateStamp","text",pageNumber,[10, 15, 600, 0]); DateStamp.textSize=12; DateStamp.alignment="center"; DateStamp.textColor=color.gray; }


      this.setAction("WillPrint", "this.getField('DateStamp').value = \"THIS DOCUMENT IS VALID FOR 24 HOURS FROM PRINT DATE: \" + util.printd(\"mm/dd/yyyy  hh:MM tt\",new Date())");


      for (var pageNumber = 0; pageNumber < this.numPages; pageNumber++) { var FilePath = this.addField("FilePath","text",pageNumber,[10, 782, 600, 767]); FilePath.textSize=10; FilePath.alignment="left"; FilePath.textColor=color.gray; }


      this.setAction("WillPrint", "this.getField('FilePath').value = \"File Path: \" + this.path");


      Thanks in advance for any help!!