I want to open a new window in print mode, after all images loaded(and the document is ready). Here is my code:
var win = window.open();
//css ltr
win.document.write('<style>body { direction: rtl; unicode-bidi: bidi-override; }</style>');
//insert img
win.document.write('<img src="assets/imgs/logo.png">' + '<br>');
//insert txt
win.document.write(pdf);
win.document.write('<br>');
win.document.write('<img src="assets/imgs/buttomLogo.png">' + '<br>');
win.print();
win.close();
I had tried to use onLoad()
but it print the document without the pictures:
win.onload = function () {
win.print();
win.close();
}
How can I open the document in print mode with all the images? Fiddle - printer.
Thanks.