Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a page for bill printing ..i m printing whole page content through javascript func.. It is printing well whole content..

BUT IT LEAVES MUCH BLANK PAGE BELOW..

Following are javascript print fun which i use.. i m calling this fun on button click..
PrintArea is id of panel

XML
<script type="text/javascript">
    


function CallPrint() {
        var res = document.getElementById('<%=PrintArea.ClientID%>');
        var contentFormat = "<style>td{font-family:verdana;font-size:10px}th{font-family:verdana;font-size:11px;font-weight:bold}</style><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"center\" valign=\"top\" style=\"font-family:verdana; font-size:14px; font-weight:normal\">" + "</td></tr><tr><td align=\"left\" valign=\"top\" style=\"font-family:verdana; font-size:12px;height:24px; font-weight:normal\"> " + "</td></tr><tr><td align=\"left\" valign=\"top\"><br />" + res.innerHTML + "</td></tr></table>"
        var WinPrint = window.open('', '', 'scrollbars,left=0,top=0,width=500,height=600,status=0');
        WinPrint.document.write(contentFormat);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
    }
</script>
Posted

1 solution

The whole page is showing because you are printing 1 full page. Blank is not issue. issue is you are printing a page. I think your code is correct.
Thank you.
Rashed:: Bangladesh
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900