IFrame Print PDF Issue in IE

IFrame Print PDF Issue in IE

Hello I have the following code to open a print dialouge from the browser, Everything is working fine with Chrome and firefox but im not able to get the print dialouge from IE with all versions, below code is specifically meant for IE11 with onreadystatechange function been added and rest is same for all other browsers where I am getting the print dialouge. I was able to save the pdf and when I try open that pdf from IE, I am getting the print dialouge directly. Also its working fine when I keep any alert inside HandleIFRa...method and somehow its not working without that alert.

<iframe name="pdfIFrame" width="530" height="0" class="co_deliveryPreview_iframe" id="pdfIFrame" src="/V1/Delivery/Print.pdf?deliveryId=i0adc40db00000149c0e4b7102093eb14&amp;rnd=0.18330521875832473#view=Fit&amp;navpanes=0&amp;toolbar=1&amp;scrollbar=0&amp;statusbar=0" frameborder="0" onreadystatechange="Cobalt.Delivery.Pdf.Instance().HandleIFrameOnReadyStateChangedForIE11(this)"></iframe> HandleIFrameOnReadyStateChangedForIE11: function(theIFrame) { //alert('HandleIFrameOnReadyStateChangedForIE11'); var doc = null; //var PDF = document.getElementById(iframeID); //PDF.focus(); //PDF.contentWindow.print(); try { doc = theIFrame.contentDocument; } catch (e) { alert(e.message+e.description+e.stack); doc = theIFrame.ownerDocument; } //alert(doc.readyState); //Cobalt.Widget.DeliveryMessageBox.Instance().RemoveAfterTimeout(1000); if (doc.readyState == "complete") { Cobalt.Widget.DeliveryMessageBox.Instance().RemoveAfterTimeout(1000); } },