1 person found this helpful
Hope this helps!
The only problem with this, is that you can show an alert asking them if the print is required, but there's no way to stop the print from happening.
I agree with Mark, we could only show an alert box but the document would get printed eventually.
I was checking for a workaround for this, here is what I did:
I hide the actual PRINT menu item using the hideMenuItem, then added a new custom made menu item cUser:"PRINT".
If the user clicks on this menu item then it displays a alert box with two options YES/NO, so if the user press YES then I call the execMenuItem("Print").
But this has a problem, if the user press "Ctrl+P" then it will go to the print dialog box directly.
User could also click on the Print icon available in the toolbar.
These are the two problems which I am facing now.
I want to show the popup even if the user press the "Ctrl+P" or click on the Print icon.
Thanks you guys for the help, if you have any other suggestions on this please post it!
You can hide the Print icon using hideToolbarButton(), but you can't abort or redirect Ctrl+P.
My main intent is to give a feedback to the user saying printing is actually wastage of paper and should be used logically.
From the replies I guess that there is no sure shot way to do that!
People don't really pay much attention to this kind of messages. They just
automatically click Enter and are annoyed at the extra step they have to
take before doing what they wanted to do.