Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

JoshDBoyle-DVzR
Level 4
Level 4
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
Niall_O_Donovan
Level 10
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
pguerett
Level 10
Level 10
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.