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 :

<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.outerHTML = "";

and then I call that function using this :

<table width="533"  border="1" cellpadding="0" cellspacing="0">
    <td>Click the button to print me</td>

<input name="btnPrint" type="button" id="btnPrint" value="Print" onClick="'none';printme();">

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
Updated 1-Jul-14 21:05pm
deepakaitr12345 2-Jul-14 10:16am

Hope above link will help you...


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