My Adobe Pro 9 Livecycle 8.2 form is dynamic, reader rights enabled, security set to allow form field entries and low res printing. My Reader is v9. I searched for a solution in the forums but found none.
Among all of my form's subforms, two are normally hidden until called with a button object scripted to print its associated hidden subform. (making the subforms invisible would disrupt the astetics when viewed in Reader) To keep it simple I'll only show a script for one button which is common for both, except for the proper SOM's naturally.
I began with the following on a click event:
frontPageData.presence="visible";
frontPageData.relevant="+print"; // I think it defaults to this anyway?
xfa.host.print(1, "1", "1", 0, 0, 0, 0, 0);
frontPageData.presence="hidden";
Nothing happened. So I tried each of the following steps in succession:
-Changed to a mouseup event //sometimes Reader responds to this better?
-Put the last line in a postPrint event
-Put the first 2 lines in a prePrint event
-tried all of the above steps in both javascript and formcalc
None of the above results in any activity (e.g. the printer dialog box for windows doesn't open). I verified that I can print a random document from Reader manually (file>print). I'd try more, except its such a small script that I don't know what else to try.
I'd suggest testing the "xfa.host.print" line by itself.
On a general note, I've had lots of problems in the past with trying to set something as visible, printing, and then hiding it again. It seems that Acrobat doesn't always get the setting up to date before sending the doc off to the printer. There's a bit of a timing issue.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script