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

Print Current Page

Biffnet7
Registered: Dec 9 2009
Posts: 36

Hello.

I have created a multipage Static form using Livecycle and there is a problem with printing the current page.

We use a multiple page form that I have added Print Buttons to each page in the form so users do not end up printing out every page when they print. When the Print Dialogue screen opens the page range is correct but it always ends up printing out all the pages anyway. If I reselect a printer then it will work correctly and print out the pages in the desired range. Is this a bug?

Do I always have to print by Page range? I think that is the problem. Is there a script to print the current page you are on without entering in page ranges in the script?

Thanks for all your help.

Biff

Allen

My Product Information:
Acrobat Pro 9.2, Macintosh
jonom
Registered: Jan 31 2008
Posts: 133
Hey Biff, I responded on the Google Group but I'll put it here too.

Here's some scripts I use. I don't know if it will make a difference
on the Mac or not.

Are you using xfa.host.print()?

For a list of the variables for xfa.host.print() check the help under:
Scripting > Scripting Reference > Scripting Methods > printThe main thing to remember is that the page numbers are zero-based; so
page 1 is page zero in Javascript.

The following will print the page that the button is on:
var thisPage = xfa.layout.page(this);
xfa.host.print(1, (thisPage-1).toString(), (thisPage-1).toString(), 0,
0, 0, 0, 0);

You can do this for specific ranges of flowing forms too by setting up
a field to track the value of a page number. I've set up a few forms
that flow and can add quite a few pages which have a page or two of
instructions that follow the form pages. I have a print button that
prints the form pages without the instructions and a print button on
the instruction pages that will just print the instructions.

To do this I put an invisible numeric field at the end of the subform
flow called thisPage with the following on the Layout:Ready event of
the field:
this.rawValue = xfa.layout.page(this);

Then on the print buttons (which I have on the master pages - 1 master
page for the form and 1 master page for the instructions) I have the
following:

This will print from page 1 to the page the tracking field is on (the
form pages):
xfa.host.print(1, "0", (path.to.subform.thisPage.rawValue-1).toString
(), 0, 0, 0, 0, 0);

This will print from the page after the tracking field is on to the
end of the document (the instruction pages):
xfa.host.print(1, (path.to.subform.thisPage.rawValue).toString(),
"0" , 0, 0, 0, 0, 0);
Biffnet7
Registered: Dec 9 2009
Posts: 36
I have been using xfa.host.print(). Thanks for the script help. I can see where I went wrong. For some reason it doesn't seem to Work with Acrobat v9 on a Mac. On a PC and on a Mac with version 8 it prints out just the page or the page ranges correctly but for our Macs that have Acrobat 9 it prints out all the pages, ignoring the page selection. Unless we reselect our printer. Then it seems like it kicks our printer options to notice that it is to print the current page or page range only.

Is this a version problem?

Biff

Allen

jonom
Registered: Jan 31 2008
Posts: 133
Can't help you with that...sounds like it might be a bug.

Is Acrobat 9 patched up to date?

You might want to file a bug report with Adobe.
Biffnet7
Registered: Dec 9 2009
Posts: 36
Thanks for all the help. I am still very new to Livecycle so I'd like to ask if something would be possible with these forms.

My current PDF is a 6 page static form. The forms themselves are different but the fields on them use the same information. That is why I made 1 PDF of all these forms. So we would not have to input the same information over and over again in each form. Currently we fill out one of the forms, save them, and then as we work on a project we print out the other forms as needed. That is why I was looking for a script that can print out the current page only.

Can Livecycle Designer be used to create a Dynamic Form where when you open the form, a main page with buttons on it is shown that has the name of the form you need? Clicking on the button brings up that Form only. You fill out the information and save the PDF. Later on when you need the other forms you can open this same PDF and open the other forms. The fields on the first form that you filled out will be populated on the other forms with the same field names. The difference between this form and the static form we currently use would be that it doesn’t show up in Acrobat as a 6 page form. It shows up as a 1 page form and keeps the information that we put in to the fields as the project progresses. As we need the other forms we click the button in the main page. This main page is replaced by the form you just selected.

Sorry for the information overkill.

Thanks

Biff

Allen

jonom
Registered: Jan 31 2008
Posts: 133
Biffnet7 wrote:
Can Livecycle Designer be used to create a Dynamic Form where when you open the form, a main page with buttons on it is shown that has the name of the form you need? Clicking on the button brings up that Form only. You fill out the information and save the PDF. Later on when you need the other forms you can open this same PDF and open the other forms. The fields on the first form that you filled out will be populated on the other forms with the same field names.
Definitely! You can hide and show pages, etc. You use the "presence" attribute like when showing and hiding subforms, fields, etc.

You'll need to remake the form as Dynamic.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

if you work on Mac you don't have LiveCycle Designer (and your thread is placed in the from forum ;-) ).
That's why the script xfa.form.print() won't work.
It only can be used with XFA-forms (LiveCycle), not on AcroForms (Acrobat).

In Acrobat you need:

this.print(false, this.pageNum, this.pageNum);
For more input about the print method in Acrobat see the JS API reference manual (page 326).

[url]http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

jonom
Registered: Jan 31 2008
Posts: 133
He is using LiveCycle, he just found a potential bug in the print engine for Mac Acrobat (it's not honouring the page range settings in the script).