Why this does not works? Only loading the page. Not getting printed. Here I take the src of an iframe and open that url in new window.
var myDivObj = document.getElementById('resumedocument').src;
var someXml = '<html><title>Resume</title><body onload="window.print();"><iframe style="height: 1000px; width: 1260px;" src="' + myDivObj + '"/></body></html>';
var printwindow = window.open('', '_blank','fullscreen=yes');
printwindow.document.write(someXml);
printwindow.onload = function() {
printwindow.self.focus();
printwindow.self.print();
};
1 Answer