Expand my Community achievements bar.

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

Avatar

Former Community Member
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
2 Replies

Avatar

Level 10
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

Avatar

Former Community Member
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.