We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have an application using printJS, and I have the following call:
printJS({ printable: printableContent, type: 'raw-html', onPrintDialogClose: myMethod, title: 'My Title' });
I need to print silently (ex. print.always_print_silent on Firefox). Which I have configured in my client browser successfully.
I have also added the following event listeners for "focus" and "afterprint"...
window.addEventListener("afterprint", function(event) { myMethod(); }); window.addEventListener("focus", function(event) { myMethod(); });
However, none of these event listeners get triggered when I'm in silent print mode. The onPrintDialogClose feature does not get triggered either.
How do I determine when the print job finishes if I'm in silent print mode?
The text was updated successfully, but these errors were encountered:
Hey, today I had this problem, and was fixed this way:
window.onafterprint = () => { try { window.close(); // change window.close for your code setTimeout(() => window.close(), 300); } catch (error) { console.error( "🚀 ~ file: index.html:37 ~ cerrarVentana ~ error:", error ); setTimeout(() => window.close(), 300); } };
I don't know why, maybe when silent mode is on, there is no time for it to activate.
Sorry, something went wrong.
No branches or pull requests
I have an application using printJS, and I have the following call:
I need to print silently (ex. print.always_print_silent on Firefox). Which I have configured in my client browser successfully.
I have also added the following event listeners for "focus" and "afterprint"...
However, none of these event listeners get triggered when I'm in silent print mode. The onPrintDialogClose feature does not get triggered either.
How do I determine when the print job finishes if I'm in silent print mode?
The text was updated successfully, but these errors were encountered: