本文介绍了如何使用自定义打印大小调用Internet Explorer的打印预览?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...

当我想创建一个使用Internet Explorer打印预览网页的功能时,我遇到了问题。我试图使用以下代码调用打印预览选项:



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.ExecWB(7,2);
iPrint.outerHTML = "";
}
</script>







然后我叫那个使用此功能:






and then I call that function using this :

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







但是当我试图执行。我打印打印尺寸缩小到适合打印预览选项。我需要使用打印尺寸自定义值调用打印预览选项,或者示例为75%。

我需要从后面的代码设置打印尺寸。

请帮帮我...



提前谢谢

Damanik




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

推荐答案

这篇关于如何使用自定义打印大小调用Internet Explorer的打印预览?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 03:45