title: How to detect window.print() finish
body: <p>In my application, I tried to print out a voucher page for the user like this:</p>
  
  <pre><code>  var htm ="&lt;div&gt;Voucher Details&lt;/div&gt;";
    $('#divprint').html(htm);
    window.setTimeout('window.print()',2000);
  </code></pre>
  
  <p>'<code>divprint</code>' is a <code>div</code> in my page which store information about the voucher.</p>
  
  <p>It works, and the print page pops up. But I want to advance the application once the user clicks '<code>print</code>' or '<code>close</code>' in the browser's pop-up print dialog.</p>
  
  <p>For example, I'd like to redirect user to another page after pop up window is closed:</p>
  
  <pre><code>window.application.directtoantherpage();//a function which direct user to other page
  </code></pre>
  
  <p>How can I determine when the pop up print window is closed or print is finished?</p>