87,991
社区成员
发帖
与我相关
我的任务
分享<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<!-- 插入打印控件 -->
<object id="jatoolsPrinter" classid="CLSID:B43D3361-D075-4BE2-87FE-057188254255"
codebase="jatoolsPrinter.cab#version=5,7,0,0">
</object>
<script type="text/javascript">
function doPrint(how) {
//打印文档对象
var myDoc = {
documents: document, // 打印页面(div)们在本文档中
copyrights: '杰创软件拥有版权 www.jatools.com' // 版权声明必须
};
// 调用打印方法
if (how == '打印预览...')
jatoolsPrinter.printPreview(myDoc); // 打印预览
else if (how == '打印...')
jatoolsPrinter.print(myDoc, true); // 打印前弹出打印设置对话框
else
jatoolsPrinter.print(myDoc, false); // 不弹出对话框打印
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id='page1' style='width:300px;height:300px;'>
test
</div>
<input type="button" value="打印预览..." onclick="doPrint('打印预览...')"/>
<input type="button" value="打印..." onclick="doPrint('打印...')"/>
<input type="button" value="打印" onclick="doPrint('打印')"/>
</form>
</body>
</html><!-- 插入打印控件 --> <object id="jatoolsPrinter" classid="CLSID:B43D3361-D075-4BE2-87FE-057188254255" codebase="jatoolsPrinter.cab#version=5,7,0,0"> </object>
