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

Print Question - HELP please.

rodbunn
Registered: Feb 3 2008
Posts: 81
Answered

I'm going crazy with this one. :

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

Is there a way in the "print" command to make it print from a page # (that's
the second field) to the end of the document? So, what I'm asking is there
anything I can put in the third field (where the 2 is in this example) that will
make it print all pages??? I tested out putting in a number GREATER than the
existing pages and it just sits there, doesn't do anything. THis command needs the exact number of pages that exist when called upon to print.

The reason I need this is; I un-hide part of the form that I want to print, this part of the form is VARIABLE in length, it can grow up to 2 pages longer (so from 1 to 3 pages total). the command doesn't work if I put "3" for the last page to print and 3 doesn't exist.....

Thanks for any help!

Rod

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Your code will print page 2 and 3 of the docuemnt. If you need to provide a dynamic last page you would have to use the "xfa.host.numPages" to get the number of pages and then adjust the value by -1 and convert the result to a string.

xfa.host.print(1,"1",Str(xfa.host.numPages - 1),0,0,0,0,0)

George Kaiser

rodbunn
Registered: Feb 3 2008
Posts: 81
THANKS !!!! That works perfectly. I run it after I hide the pages I don't want printed and it has the correct # to print !!!!

So I used this: xfa.host.print(1,"1",Str(xfa.host.numPages - 1),0,0,0,0,0)


Rod