Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to down load a .pdf file from http://.....url and Print that file with in abutton click?
I want the print code in C# .net specially.
Posted
Updated 27-Jun-12 23:40pm
v3
Comments
Sandeep Mewara 28-Jun-12 6:25am    
What have you tried so far?

1 solution



<input type="button" value="print " id="btnPrint" runat="server" önclick="javascript:CallPrint('print')" />


<script type="text/javascript">
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=800,height=800,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
</script>
 
Share this answer
 
v2
Comments
Sandeep Mewara 28-Jun-12 6:25am    
OP said winforms specifically. This is web based.

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