I have come out here in the past and been able to get some really great help. I hope that it continues. I have a 26 page document that has a 9 page form in it. I would like to be able to put a print button in that automatically sets it up to print just the form. Can someone please tell me it this can be done? Thank you.
In the print command you can pass a page range to print. Note that this will only work if your users press the print button on your form and not the Print command on the toolbar or Ctrl-p.
The second parameter is a 0 based page number to start at and th e3rd parameter is a 0 based paged number to end at.
Like always you are a great asset to these forums. Thank you but I have one more question to add to this. I just put in the button and the code that was created was
You could also, in the pre-print event, hide all of the pages that will not be printed. Then in the post print event, you show them again. That may get the effect you need.
I have a multi page form, in which the number of pages grow depending on user inputs. At the end I have a series of individual pages that the user can print off. I wanted a button on each page that when clicked would print off that one page only. Because I did not know the page number at run time, I set up a numeric field (hidden) called this_page with the following Javascript in the Layout:Ready event:
"this.rawValue = xfa.layout.page(this);"
Then in the regular button click event I had the following Javascript:
Therefore no matter what the number of pages visible at run time, the button would print off that one page. There was one incidence where I wanted the button to print off two consecutive pages and all I had to do was amend the 3rd variable to "(this_page.rawValue).toString(),".