Expand my Community achievements bar.

Print HELP page / print specific page

Avatar

Former Community Member

My form has a hidden HELP page that is accessed by clicking a button.  It is the last page and has a button to close/hide it again.  I set the form up so that the HELP page, whether visible or not, is not counted in the total number of pages/page count ("Page # of ##") displayed at the bottom of all of the other pages.  I further put in the Action Builder to hide the HELP page upon saving or printing.

However, someone wants to print the HELP page.  I can put a "Print HELP" button on the HELP page and even code it to print a single page--BUT...

The Action Builder sequence hides the HELP page upon pre-printing.  Oops.

I want a user to be able to print the HELP page only by clicking the "Print HELP" button.  When clicked, I want the HELP page--and only the HELP page--to print.  (Paper conservation.)  Otherwise, I want to maintain the auto-hiding of the HELP page upon saving or printing.

Radzmar gave this bit-o-code:

  var pp = event.target.getPrintParams(); 

  pp.interactive = pp.constants.interactionLevel.full;

  pp.printRange=[[1, 1], [3, 4]]; 

  event.target.print(pp);

And there is the pageCount routine to get to the last page:

  xfa.host.currentPage = xfa.layout.pageCount();

However, the pre-print coding of my form hides the HELP page prior to printing.  Suggestions on bypassing the pre-print hiding of the HELP page when it is the HELP page itself that needs to be printed?

1 Reply

Avatar

Level 4

Capture Print Help Page 2.PNG

What I did is, I set a button at the bottom of the form to let the user see the help page if necessary. The Help Page is set to "Hidden" in the presence on the object palette. The button itself is "Visible Screen Only" (why that's not the default for all buttons is beyond me).  Then I created the Condition in the Tools/Action Builder that when the "Show Help Page" button is clicked,Page2 (the help page becomes visible) If you printed the file now, both pages would print.

Capture Print Help Page 1.PNG

But since you want the user to be able to print ONLY the Help Page on occasion, I then created a second script using a standard print button, that sets the script to "When Print Help is clicked, set the visibility of Page1 (the form) to hidden and set the visibility of Page2 to visible".

I exited from the Action Builder and in the script editor, changed the print string of the button as follows:

Capture Print Help Page 3.PNG

changing the "0" to "1" and that solved the problem with what prints when. If you would like me to send you the working sample, just email me at:

jeanette@forms-and-more.rocks