I have project that require save something to database after click print button on browser print dialog (window.print).
I have try onafterprint
based on How to detect window.print() finish
but when i click cancel or close it still save to database.
any idea how to save to database only on click print button ?