We have a form with 23 pages, the first 6 pages are instructions. We would like the user to be able to print out these instructions separate from the rest of the document. Then we would like another print button at the bottom of the document to print the remaining pages which are actually an application which needs a signature (17 pages).
The current print script is:
xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
and it prints the entire document.
Thanks for your help.
Solved! Go to Solution.
Views
Replies
Total Likes
xfa.host.print(0, "6", "22", 0, 0, 0, 0, 0); will print pages 7 to 23 with no prompting.
Views
Replies
Total Likes
Views
Replies
Total Likes
Ok, I'm sorry but I am script challenged and that page means nothing to me. Is there a way to change that script above to make it print pages 1 thru 6 and then another print button scripted to print 7 thru 23?
Views
Replies
Total Likes
xfa.host.print(0, "0", "5", 0, 0, 0, 0, 0); will print pages 1 to 6 with no prompting.
Views
Replies
Total Likes
xfa.host.print(0, "6", "22", 0, 0, 0, 0, 0); will print pages 7 to 23 with no prompting.
Views
Replies
Total Likes
Ok and then how would I tell it to print pages 7 thru 23?
Views
Replies
Total Likes
Hi,
The print method requires eight parameters.
The second parameter "0" is the start page for the printout, using a zero-based numbering system. Eg "0" is the first page.
The third parameter (xfa.host.numPages -1).toString() is a calculation for the last page to be printed in the range. It calculates the total number of pages and then subtracts 1 to get it into the zero-numbering system and then converts it to a string for the print method.
So in your case the Print Instructions button would have the following script in the click event (changing the finish page):
xfa.host.print(1, "0", "5", 0, 0, 0, 0, 0);
And your Print the Rest of the Form button would have the following (changing the start page):
xfa.host.print(1, "6", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
Make sense?
Niall
Views
Replies
Total Likes
You anticipated that I wouldn't know how to script the second button. It prints beautifully, you are a genius. However it does prompt before printing. It says "This document is trying to print. Is this ok? ) ever so politely. I can live with that. Thank you very much.
Views
Replies
Total Likes
Thank you for seeing that I was struggling with this and for helping out. You script is going right on my wall. This prints much more smoothly. Thank you, thank you, thank you, as always.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies