Why does this javascript only work for 2 page documents? Trying to use it for a 3 page document
Hello,
IT guy for a small company here. I'm attempting to use a javascript file to print a number in the bottom corner of each page of a document, then incrementally for each copy of the document.
This JS works for 2 page documents but when I try to use the same code for a 3 page document to do the exact same thing it only prints the number on the first two pages
//-------------------------------------------------------------
//-----------------Do not edit the XML tags--------------------
//-------------------------------------------------------------
//<AcroForm>
//<ACRO_source>Print:Annot1:MouseDown:Action1</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:Print:Annot1:MouseDown:Action1 ***********/
var snum = app.response("Please Enter Starting Number","");
var f = this.getField("Serial Number");
f.value = snum;
var copies = app.response("Please Enter Number of Copies to Print","1");
if (copies == null || copies ==="" || copies === 0) {
txt = "No Copies Printed";
} else {
for (i=0; i < copies; i++) {
f.value = Number(f.value)+1;
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.silent;
this.print(pp);
}
}
//</ACRO_script>
//</AcroForm>
admittedly I have no experience with JS and this script was set up by the guy I replaced (whether he wrote it himself or found it online i'm unsure).
