I have a form with a print button. I need the button to print three copies with a field change on each copy. When I use this code the field jumps to the last value and prints it three times.
Any thoughts?
Thanks in advance.
Views
Replies
Total Likes
Hi,
all you need a a function with a loop.
//Declare function
function printCopies (vField) {
var vValues = ["Original", "Acounting", "Departmental"];
for (var i = 0, j = vValues.length; i < j; i += 1) {
vField.rawValue = vValues[i];
xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);
}
}
// Execute function
printCopies(xfa.resolveNode("form1.#subform.Textfield1"));
Hope this helps!
Views
Replies
Total Likes
thank you for your feedback.
Using the function it is still cycling through and prints all three copies with "Department" .
Views
Replies
Total Likes
Um, you're right, the solution does not work properly.
I made another sample with a much more complex solution.
It uses a global variable to count the number of times the forma has been printed.
https://files.acrobat.com/a/preview/01c6a4be-5489-484f-8042-55a3ad697ccb
Views
Replies
Total Likes
Views
Likes
Replies