Highlighted

app.execMenuItem("Print") Not Working in Reader 9.1

JoshDBoyle-DVzR

02-04-2009

All



I have a 15 page PDF form with a print button that leverages the following line of Javascript to invoke Reader's printing menu option:



app.execMenuItem("Print");



In prior version fo reader (7, 8 and even 9.0) this works properly. However, now in 9.1, I receive a dialog when I try to print stating that no pages were selected to print. This only occurs in 9.1.



Did something change with the printing capabilities with the 9.1 reader release? If so, how can I achieve this functionality?



Thanks

Replies

Highlighted

Niall_O_Donovan

02-04-2009

Hi,



In LC Designer, there is a standard script in the Print button:



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



The second parameter tells Acrobat the start page and the third parameter sets the last page to be printed (both are based on a zero page numbering system). The help file sets out the different parameters.



In AcroForms the following should print:



this.print({nStart: 0, nEnd: 7, bShrinkToFit: true});



Good luck,



Niall
Highlighted

pguerett

02-04-2009

Niall is right ..thats how the printing should be done but it does not explain why your code does not work. I tried it on my version 9 and it worked fine. Is it possible that printing was disabled for that doc? Hit Ctrl-J and see if there are any javascript error messages.