One of mine application having custom button to print the customer invoice bill. The browser also having default print option (Cntrl + P) to print the window content.
Initially, I resolved this problem by adding:
$(document).ready(function(){
$(document).keydown(function(event) {
if (event.ctrlKey==true && (event.which == '80') { //cntrl + p
event.preventDefault();
}
});
});
But I feel, this is not feasible solution for this. because am here binding this (keydown) event on document. so on each and every key press on application it firing this (keydown) event, and so which is very critical as per as the performance concern.
Is there any other-solution for this, so that i could disable the Cntrl + P (without binding event)?
Note: Important and good thing is our customer uses only Google Chrome browser to access this application.
As per my understanding, if some one have professional web based POS or business app, so for printing purpose you could use JZebra java applete, this would really resolve your all problems, because it doesn’t have any dependencies on browser like print preview or browser’s inbuild css etc..