Click here to Skip to main content
15,945,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi everyone...
i have a problem when i want to create a function to print preview a webpage using Internet Explorer. i have tried to call the print preview option using this code :

JavaScript
<script language="javascript">
function printme()
{
var PrintWebBrowser = '<OBJECT ID="iPrint" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', PrintWebBrowser );
iPrint.ExecWB(7,2);
iPrint.outerHTML = "";
}
</script>



and then I call that function using this :

HTML
<html>
<head>
<title></title>
</head>
<body>
<table width="533"  border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td>Click the button to print me</td>
  </tr>
</table>
<br>

<input name="btnPrint" type="button" id="btnPrint" value="Print" onClick="JavaScript:this.style.display='none';printme();">
</body>
</html>



But when I tried to execute. i call the print preview option with print size Shrink to Fit. I need to call the print preview option with print size Custom value or for the example 75%.
I need to setting the print size from code behind.
Please help me...

Thank you in advance
Damanik
Posted
Updated 1-Jul-14 21:05pm
v2
Comments
deepakaitr12345 2-Jul-14 10:16am    
http://forums.asp.net/t/1095049.aspx?access+print+preview+option+of+internet+explorer

Hope above link will help you...

Thanks

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