Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Problem automatically print

Avatar

Level 2

Hi, I have a problem with the printing of my form.


We want to be able to show the print dialog automatically when the form is opened.
The problem is that the print dialog selects a print range from 1 to X and when I select
the range 'All' the X value increases with a couple of pages. So, is there a possibility that when
the function xfa.host.print(...) is called, the layout changes and the pagelength grows?
The default value of the print dialog should be 'All'.

You can have this selected when you do 'xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);'.

But because of the total page change it selects 'From 1 to X'.


Does anyone has an idea how I can resolve this?

So how you can have the right value of the numPages during printing?

Thanks in advance!

25 Replies

Avatar

Level 2

Hi Niall,

I've created a zip folder with my test documentation, the test forms and the test xml files.

https://acrobat.com/#d=hyLaEEdS-yuZ9o5IP0ny9g

Let me know what you think about it.

Thanks a lot for your help!

Kristof

Avatar

Level 10

Hi Kristof,

I have the files, however as soon as I try and do anything, I lose the fragments and the form just stops working.

However a couple of things:

On the "Template_formFunctions_RE_cert.pdf" I am still getting an error calling the script object:

Acrobat1.png

Also i see that with the "Exchange.xml" data, the document IS a 20-page form, but that on prePrint becomes a 25-page form. Even though the dialog says "print 1 to 20", it actually prints the full 25 pages. Then the form reverts to a 20-page form.

Acrobat1.png

The functionality appears to work, albeit that the dialog is misleading.

I was trying:

...

if (status > 0)

{

     xfa.host.importData();

     app.setTimeOut('xfa.resolveNode("FAVV.#variables[0].FormFunctions").preparePrint();', 1000);          

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

}

...

But as soon as I change the form, I am unable to run it in Acrobat.

I still think it is a scripting issue, in that the form hasn't fully rendered the changes before the dialog is called.

Niall

PS You provided a very detailed description of the problem - thanks!

Avatar

Level 2

Niall,

I'm not getting 25 pages printed, the total page number is still 20 in my form. See the screenshot.

This happens in Acrobat as well as in Reader.

screen10.jpg

Avatar

Level 10

Hi Kristof,

I actually hit the print button and it printed 25 pages. The clear difference between our screenshots is than in the Preview: Composite, I have 25 pages, while you have only 20????

I am using Acrobat Pro v9 on a Mac. However when I went back and tried it on Windows Acrobat Pro Extended v9, I got the same behaviour as you have.

I am out of ideas. Maybe you should log a bug and see if someone else can track down what is happening.

Good luck,

Niall

Avatar

Level 2

Yes, it's really strange. But it also is weird that the print dialog is not selecting the 'All' radiobutton.

And that is what our client is asking for. So that's also a problem on a Mac apparently..