I've read several posts about this, but I write what happens to me. I have this code:
$(document).ready(function() {
window.print();
window.close();
});
Ok. Print dialog appears. When I click 'print', my window is closed, but it doesn't print anything. I think that window is closed very quickly.
I can set a setTimeout, but I don't know if I going to print one page or one hundred pages. This solution doesn't valid to me.
With javascript or jquery can I control the print job? Objetive is close the window when the pages have been printed.