Expand my Community achievements bar.

Print button for a specific page

Avatar

Former Community Member
I have a 2-page form made in Designer 8.0



I would like to put a print button on each page; button on page 1 will print only page 1, button on page 2 will print only page 2.



Would someone please let me know what would be the code to use for each button?



Thanks in advance.
3 Replies

Avatar

Level 5
Locate a copy of the Acrobat JavaScript Scripting Reference, this and much more is described there.



Page 1: event.target.print({bUI: false, nStart: 0, bShrinkToFit: true});



Page 2: event.target.print({bUI: false, nStart: 1, bShrinkToFit: true});



No Option to change printer using this method. If you allow bUI, then you cannot restrict page to print.

Avatar

Former Community Member
If you still want the print dialog box to pop up in order to be able to change the printer, you could also just alter the script on the standard print button. For example:



xfa.host.print(1, "0", "0", 0, 0, 0, 0, 0);



Parameter 1 allows the print dialog box to come up, parameter 2 ("0") is the starting page and parameter 3 (also "0") is the ending page. So this script will print page 1 only of a multi-page document and still allow the user to change the printer.



For a full explanation of all 8 parameters search for "print scripting method" in the LiveCycle Designer Help.