title: window.print() in same window vs new window
body: <p>Can any one help with this .</p>
  
  <p>Case 1: Print in same window.</p>
  
  <pre><code>var restorepage = $('body').html();
  var printcontent = 
  $('#ctl00_WebPartManager_BlankWP0_CanvasControl_Canvas').clone();
  
  $('body').empty().html(printcontent);
  window.print();
  $('body').html(restorepage);
  </code></pre>
  
  <p>Output: This is perfect for me , the only thing is after i restore the original controls they dont seem to work . So I am trying to print the same using a new window.
  <a href="https://i.stack.imgur.com/nHLoS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nHLoS.png" alt=""></a></p>
  
  <p>Case 2: Print in a New window</p>
  
  <pre><code>    var w = window.open();
      var printcontent = $('#ctl00_WebPartManager_BlankWP0_CanvasControl_Canvas').clone();
      $(w.document.body).empty().html(printcontent);
      w.focus();
      w.print();
      w.close();
  </code></pre>
  
  <p>Output : The Images are realigned and even image goes missing.
  I need the Case1 Output , but in a new window , so as the original window is not modified.
  <a href="https://i.stack.imgur.com/8a6M8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8a6M8.png" alt="enter image description here"></a></p>