Is it possible to print to 4 or 6 pages of my form twice and the other 2 pages once, do I need to do this from an external PDF?
Solved! Go to Solution.
Views
Replies
Total Likes
This is actually much simpler than it might sound. You can use this script to print all the pages in a form:
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
To print them twice, simply insert the line twice, like this:
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
In order to print just the last 2 pages of a 6 page form, you would add this script:
xfa.host.print(0, "3", "5", 0, 0, 0, 0, 0);
Bear in mind that page values are zero based which is why you would use "3" to represent page 4 and "5" to represent page 6. So, to print all pages twice and the last two pages once, your entire print script would be:
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
xfa.host.print(0, "3", "5", 0, 0, 0, 0, 0);
You can find the print method that defines all the values in the print script in the help section under Scripting Methods > print.
Hope this helps,
Dave
Views
Replies
Total Likes
You can control the page numbers to print but I do not think you can control th enumber of copies to print. You may have to issue multiple print commands to accomplish what you want.
Paul
Views
Replies
Total Likes
This is actually much simpler than it might sound. You can use this script to print all the pages in a form:
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
To print them twice, simply insert the line twice, like this:
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
In order to print just the last 2 pages of a 6 page form, you would add this script:
xfa.host.print(0, "3", "5", 0, 0, 0, 0, 0);
Bear in mind that page values are zero based which is why you would use "3" to represent page 4 and "5" to represent page 6. So, to print all pages twice and the last two pages once, your entire print script would be:
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
xfa.host.print(0, "3", "5", 0, 0, 0, 0, 0);
You can find the print method that defines all the values in the print script in the help section under Scripting Methods > print.
Hope this helps,
Dave
Views
Replies
Total Likes
You either use multiple print commands (has showed by the previous posters) or you create visible print only "copies" of the pages you want to print twice in your form. This does the trick but requeries a bit of work and will make your PDF bigger (disk size).
Thank you, after a few modifications I got it working as I want it to.
Views
Replies
Total Likes