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

Javascript for printing current page in LiveCycle Designer

bfalor
Registered: Aug 30 2007
Posts: 12

I'm having trouble finding a javascript that will allow a print button to print only the current page in LiveCycle Designer. The document that requires this is dynamic and the page number for any page can change at any time. Therefore, using a page number for first and last page will not work. Any ideas?

E-Forms Developer

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So you want to be able to identify the page number?

If this is the case then you need to first identify a form element that's on the page you want to print, then find the page from it, with the "layout.absPage()" function. Look it up in the XFA Object Reference.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

bfalor
Registered: Aug 30 2007
Posts: 12
That's not really it. I need to be able to print the current page even though the pages in this booklet are built dynamically and the page number will change from one build to the next. I want to be able to put a print button on each page that will print that page only, but because the page numbers are always changing depending on various factors, I cannot set up the print button to key on a specific page number. Hope this clarifies things a little.

E-Forms Developer

bfalor
Registered: Aug 30 2007
Posts: 12
Thom - I used your idea and it works great when using Acrobat Pro 7 or Reader 7, but does not work in Reader 8.0. I think the problem is that in Reader 8 there is a different page range in the Print Dialog Box. The previous version had 2 page range entry boxes - from and to. The new version has only one entry box in which you enter "from - to". Therefore the print JS using script xfa.host.print(1, "0", "0", 0, 1, 0, 0, 0); does not work. Any other ideas? Thanks again.

E-Forms Developer