I'm printing a html retrieved from back end.
printHtml(htmlTemplate) {
var printWindow = window.open('', '_blank');
printWindow.document.write(htmlTemplate);
setTimeout(function () {
printWindow.document.close(); // necessary for IE >= 10
printWindow.focus(); // necessary for IE >= 10*/
printWindow.print();
printWindow.close();
}, 1000);
}
This works fine in all browsers and only thing I can't figure out is how to stop the pop up blocker. Can't use printWindow.location because the html is there in a variable.