I have set up a certificate using a modified multiple ticket script from PlanetPDF to auto number a certificate. It said to "comment out the app.alert for continuous printing" but did not say how to do that. I am new at javascript and don't how to, so now when I print say 50 certificates, the print window pops up each time and I have to hit OK for each one!
Of course I would love to have the form keep up with the last number printed - as if it were an invoice (I tried the global.js and it kept up with numbers, but I can't print several at one time without it printing the same number!).
So my workaround would be simply auto number, print say 50, modify the Certificate No. by adding the first digit of last number printed and so on.
the script is below (of course it has alot of extra stuff I don't need, but I am not sure what to delete -
// ---> start code
var TicketsPerPage = 1; // tickets per page
// get number of tickets to print
var PrintNumber = app.response({cTitle: "Number to Print", cQuestion: "Enter number of tickets to print:", cDefault: 1, cLabel: "Number:"});
// print the tickets
console.show();
console.clear();
console.println("Number of tickets to print: " + PrintNumber);
var i = 0; // counter for tickets printed
// loop while the counter "i" is less than the number of tickets to print
do {
// number next group of tickets until ticket limit reached
for (j = 0; (j < TicketsPerPage & i+j < PrintNumber); j++) {
console.println(j + " " + (i + j + 1));
this.getField("certNo."+j).value = util.printf("%,103d", i + j + 1)
} // end for j
// void ticket stubs not printed
for (k = j; k < TicketsPerPage; k++) this.getField("SequenceNumber."+k).value = "VOID";
// increment tickets printed by 8 tickets printed
i = i + j;
// print page of tickets
app.alert("Insert page to print");
this.print();
// clear the form
this.resetForm("SequenceNumber");
} while (i < PrintNumber);
// ---> end code
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com