There are 2 files: index.html
and print.html
First one contains a button that opens print.html
using simple command:
there is a Chrome bug where window.print()
does not work when there is a tag in the DOM. It might be solved by calling this function:
function printPage() {
window.print();
//workaround for Chrome bug - https://code.google.com/p/chromium/issues/detail?id=141633
if (window.stop) {
location.reload(); //triggering unload (e.g. reloading the page) makes the print dialog appear
window.stop(); //immediately stop reloading
}
return false;
}