jquery - Javascript Print() sometimes firing print layout/paper size options and sometimes doesn't -


this exact same function using in 2 different parts of application. (which ember application). however, in first instance, when fire function, application opens new window html data on it, opens print dialog options layout , paper size.

in second instance, these options not included. why happen? or, if there better way format printing, doing wrong?

printpreview: function() { //for printing issue document     var data = $('#editdoc').editable('gethtml', false, true);     data = '<div class="froala-view">' + data + '</div>';     data = '<link rel="stylesheet" href="styles/froala_editor.css">    <link rel="stylesheet" href="styles/froala_content.css"><link rel="stylesheet" href="styles/froala_style.css">' + data;     // debugger       var printwindow = window.open('', '_blank', 'width=825,height=590');     printwindow.document.write(data);     printwindow.document.close();     settimeout(function() { //content loaded after 1 sec print invoke         printwindow.print();     }, 1000);  }, 


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -