您的位置:首页 > Web前端 > JavaScript

在JSP页面上实现简单的打印

2013-04-30 09:19 429 查看
简单点就调用window.print()

你也可以把下面代码放到你JSP中:

<html>

<head>

<title>M</title>

<style type="text/css">

.table{

text-align:center;

}

</style>

<style media="print">

.Noprint{display:none;}

.PageNext{page-break-after: always;}

</style>

</head>

<body>

<center class="Noprint">

<p>

<object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"

width="0">

</object>

<input type="button" value="打印" onclick="document.all.WebBrowser.ExecWB(6,1)">

<input type="button" value="直接打印" onclick="document.all.WebBrowser.ExecWB(6,6)">

<input type="button" value="页面设置" onclick="document.all.WebBrowser.ExecWB(8,1)">

</p>

<p>

<input type="button" value="打印预览" onclick="document.all.WebBrowser.ExecWB(7,1)"></p>

</center>

aaaa

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: