I'm working on an Angular app and I want to prevent the print dialog from opening when pressing "Ctrl + P". To address this issue, I have implemented the following code:
window.onbeforeprint = (event) => {
event.stopPropagation();
console.log('Before print');
};
Although I can see my log in the console, the window still appears. My goal is to use html2canvas and jsPDF to capture a screen of my app instead of triggering the default print function.
Is there a way to achieve this desired outcome?