These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Print Scripting Question (Printing certain pages)

stellarceo
Registered: Jan 12 2009
Posts: 8

Hello,
 
I have a 5 page document and on the second page I have a normal print button. I want to use the button to only print pages 2,4 and 5. What would be the correct Print Script for this? Currently the script is:
 
xfa.host.print(1,"0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);
 
Thanks in advance for the help.
 
Bill

Bill G.

My Product Information:
LiveCycle Designer, Windows
DaveyB
Registered: Dec 10 2010
Posts: 70
Bit late on the reply, but better late than never :)

The LiveCycle help file has a full breakdown on the parameters of the scripting command, search for "print scripting method". Since you are skipping a page, you would probably need to run two commands under the scripted event for the button, similar to this:

xfa.host.print(1, "2", "2", 0, 1, 0, 0, 0)
xfa.host.print(1, "4", "5", 0, 1, 0, 0, 0)

Add a semi-colon (;) to the end of each line if you are using javascript instead of formcalc commandsAn alternate method would be to turn on flow across your pages, and adjust the presence properties of the non-printing parts of the form to "screen only", so that at print time there would only be 3 pages sent to the printer.

Hopefully you have already solved this, but the answer may help someone else with a similar problem! :)

DaveyB

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

Masi
Registered: Sep 18 2008
Posts: 22
If DaveyB's method doesn't work, you could set the presence of pages 1, 3 and 6+ into hidden state and print "the whole document". And after printing (postPrint) set the presence back to normal. This works only if you have one master page for the whole document.
DaveyB
Registered: Dec 10 2010
Posts: 70
If that doesn't work, have them print the whole document and toss the unwanted pages into the recycling bin!

Sorry, not a productive comment, but I needed to throw some humor in somewhere! *grin*

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB