I have two texts and i want to print them on two different pages, this is what i did so far :
The button print :
<button onclick="javascript : CallPrint('idText1','idText2')" type="button">Print</button>
callPrint JavaScript method :
<script language="javascript" type="text/javascript">
function CallPrint(firstText,secondText) {
var firstContent = document.getElementById(firstText);
var secondContent = document.getElementById(secondText);
var WinPrint = window.open('', '', 'letf=0,top=0,width=1200,height=750,toolbar=0,scrollbars=0,status=0,dir=ltr');
WinPrint.document.write(firstContent.innerHTML);
WinPrint.document.write(secondContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
</script>
The problem is, they are printed one after the other. How is it possible to separate them on two different pages (without using br tags). If it is not possible, i wanna know if it is possible to show two print windows instead of one.
to separate them on two different pages- CSS page breakspage-break-after page-break-before page-break-insidecss properties and put them inside a @print css rule. There's some combination in there where you can force and element to always start a new page.