Wednesday, May 29, 2013

How to print partial pages?

<script type="text/javascript">

function CallPrint(strid) {

debugger;

var prtContent = document.getElementById(strid);

var productinfo = document.getElementById('divProductInfo');

var WinPrint = window.open('', '', 'letf=0,top=0,width=400,height=400,toolbar=0,scrollbars=0,status=0');

if (productinfo == null) {

WinPrint.document.write(prtContent.innerHTML);

} else {WinPrint.document.write(productinfo.innerHTML + prtContent.innerHTML);}

WinPrint.document.close();

WinPrint.focus();

WinPrint.print();

WinPrint.close();

} </script>

<input type="button" style="font-size: 13px; font-weight: bold" width="75px" value="Print copy"

id="btnPrint" runat="Server" onclick="javascript:CallPrint('divPrint')" />

<div id="divProductInfo" class="pro-price" runat="server">
//Your print material here

</div>



 

No comments:

Post a Comment