Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a panel with 40 picture boxes. The pictures are arranged in 8 rows x 5 cols vertically. I want to print the contents of the panel into A4 sheets. Kindly help.

Thanks in advance

Janardhan
Posted

1 solution

Use this code below :

function callPrint(ctrId)
{
   var prtContent = document.getElementById(ctrId);
   var winPrint = window.open('','','left=0,top=0,width=1,height=1
,toolbar=0,scrollbars=0,status=0');
   winPrint.document.write(prtContent.innerHTML);
   winPrint.document.close();
   winPrint.focus();
   winPrint.print();
   winPrint.close();

}


Just call the javascript method, it will print the content of the div of id ctrId.

:rose:
 
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