Expand my Community achievements bar.

SOLVED

pre print problems

Avatar

Former Community Member

Hi, I have come across a strange problem.

I have a form with multiple pages, some are visible on the screen and some are hidden but should print. I thought it would be rather simple to set the visiblitiy to present on prePrint and hide the pages again on postPrint.

But, and here comes the problem, if I use the print button the hidden pages are set to visible on the screen but they don’t print. If I use ctrl+p instead the pages are set to visible on the screen and do print. Why??

I tried to set the relevant property of the pages to print to be relevant = “+print” but that didn't change anything.

I also tried to change the target version from 8.1 to 9.0 – no success.

Can someone please help me?

Kirstine

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

So I am confused .....is it now printing th eway you want? If not can you email the form to LiveCycle8@gmail.com and I will lok into it. Please include a description of you rissue in the email.

Paul

View solution in original post

4 Replies

Avatar

Former Community Member

Which version of Acrobat/Reader are you using to view the form? What version is your template targeting?

Paul

Avatar

Former Community Member

Hi paul

I use Acrobat Pro 9.4.5 but I have tested the form in Reader 10.1.1 on a virtual machine as well.

I have tried to set the template target version to 8.1 and 9 but that didn’t make any difference.

However, I think I have come a bit closer to what happens. When I use ctrl+p the print range in the printer settings menu is set to Print Range = All.

PrintRangeAll.jpg

But when I use the print button (I use LiveCycles standard print button) the printing range is suddenly set to Print Range = Pages: 1

PrintRangePages_1.jpg

I even made a new form just to test this issue, and to make sure that the form didn’t contain any trashy leftover scripts that could interfere with the printing and show/hide pages.

As I understand the script on print button this part (marked in yellow) should make shure that all visible pages print.

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

Regards Kirstine

Avatar

Correct answer by
Former Community Member

So I am confused .....is it now printing th eway you want? If not can you email the form to LiveCycle8@gmail.com and I will lok into it. Please include a description of you rissue in the email.

Paul

Avatar

Former Community Member

After som e-mailing Paul gave me this solution:

"comment out the xfa.host.print command and put the command app.execMenuItem("Print") this will work on your button (it is actually hitting the Print command in the Acrobat menus.)"

And he also wrote:

"Ok I figured this out ......

It has to do with the order that things are happening .....

  1. User clicks the print button and casues the click event to fire.
  2. Your code gets interpretted. The xfa.host.numPages -1 gets interpretted and returns the numof pages in the document. At this time it is 1.
  3. The print command is executed.
  4. this causes the preprint event to fire and the 2nd page is made visible. But the range on th eprint cammand has already been set
  5. The print dialog comes up and it says to start printing at 0 and end at 1....hence we only see one page

Compare that to what happens when you hit the Print button outside of the form.

  1. The Cntrl-P is hit.
  2. The default range for printing is to print all pages.
  3. The prePrint event fires and shows the 2nd page
  4. The print dialog comes up and shows all pages for printing.

I issue is that you are getting the pagecount before the 2nd page is adjusted. The way you are doing it now using the app.execMenuItem is the way to do it going forward. "

Thank you once for for all your help.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----