13 lines
727 B
JavaScript
13 lines
727 B
JavaScript
function printPageContent() {
|
|
var printContent = null;
|
|
var winPrint = window.open('','', 'left=0,top=0,width=800,height=900');
|
|
winPrint.document.write("<!DOCTYPE html><html><head><base href=\'" + document.location.href + "\' target='_blank'/><title>" + document.title + "</title><style>@page { size: auto; margin: 10mm; } .page,header{ page-break-inside: avoid; } .headerTD{ display:none; } * { page-break-before: auto !important; } </style></head><body>");
|
|
printContent = document.getElementById("wrapper-content");
|
|
winPrint.document.write(printContent.innerHTML);
|
|
winPrint.document.write("</body></html>");
|
|
winPrint.document.close();
|
|
winPrint.focus();
|
|
setTimeout(function(){
|
|
winPrint.print();
|
|
}, 500);
|
|
}
|