For anyone to stumble upon this answer from Google, let me try to clarify things:
As Ajay pointed out, there are two events that are triggered for printing, but they are not well supported; as far as I read, they are only supported in (6+) browsers Internet Explorer and Firefox. These events are window.onbeforeprint and window.onafterprint, which (as expected) will be fired before and after the print job.
However, as pointed out in Joe's link ( link ), this is not exactly how it is implemented in all the cases. In most cases, both events fire before the dialogue; in others, the execution of the script may be interrupted during the print dialog, so that both events can fire at the same time (after the dialog has completed).
For more information (and browser support) for these two events:
link
link
The short answer: If you're hoping to interfere with the print flow, do not do it. If you are hoping to trigger the code after printing, it will not work as you are wanting; wait for the poor browser support, and try to degrade normally.
Source: link