javascript window.print
<button onclick="window.print()">Print this page</button>
javascript window.print
<button onclick="window.print()">Print this page</button>
window.print div
// It's really that simple. Make sure the dimensions of 'elem'
// fit the width of the PDF layout you're looking for.
// FYI: IE, Edge, Chrome, Firefox, etc. all have different dimensions when
// they print.
function PrintElem(elem: HTMLElement)
{
var mywindow = window.open('', 'PRINT', 'height=400,width=600');
mywindow.document.write(elem.innerHTML);
mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10*/
mywindow.print();
setTimeout(() => {
// Without the timeout, the window seems to close immediately.
mywindow.close();
}, 250);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us