'); printWindow.document.close(); var myImage = printWindow.document.getElementById('imgid'); myImage.onload = function() { printWindow.print(); //printWindow.close(); }; }