0

I have a javascript fuction which prints out a div and returns back to previous page after a delay of say 2000ms.

<script type="text/javascript">

function printDiv() {
    var printContents = document.getElementById('printableArea').innerHTML;//printableArea is a div id which u need not worry
    var originalContents = document.body.innerHTML;

    document.body.innerHTML = printContents;

    window.print();

    document.body.innerHTML = originalContents;
   setTimeout("closePrintView()", 2000);

}
function closePrintView() {
    setTimeout("closePrintView()", 2000);
     window.location = "default.aspx";

}

But i am unable to detect whether the printer has printed or still its in spooling. I tried the afterPrint(); .but that does not give anything.

Here is my question.

Is there a java script snippet which can capture whether the printer has printed out the required information.

bk sumedha
  • 63
  • 1
  • 8
  • `I tried the afterPrint();` - what is afterPrint? but no, the browser has limited access to the operating system, thankfully `unable to detect whether the printer has printed or still its in spooling` - I think you're limited to detecting when the print dialog has closed - you can't detect anything about the progress of the print job – Jaromanda X Nov 09 '16 at 10:34
  • Can i detect whether the job has been printed or not? – bk sumedha Nov 11 '16 at 09:35

0 Answers0