web打印功能
2014-05-03 09:34
169 查看
1./article/1273885.html
2。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="PrintContent" runat="server">
ASP.NET网页打印测试<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容<br />
</div>
<asp:Button ID="btnPrint" runat="server" Text="打印" OnClientClick="return PrintArticle();" />
</form>
</body>
</html>
<script type="text/javascript">
function PrintArticle() {
var pc = document.getElementById("<%=PrintContent.ClientID%>");
var pw = window.open('', '', 'width=500,height=400'); pw.document.write('<html>');
pw.document.write('<head>'); pw.document.write('<title>ASP.NET网页打印测试</title>'); pw.document.write('</head>');
pw.document.write('<body>'); pw.document.write(pc.innerHTML); pw.document.write('</body>');
pw.document.write('</html>'); pw.document.close();
setTimeout(function () {
pw.print();
}, 500); return false;
}
</script>
2。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="PrintContent" runat="server">
ASP.NET网页打印测试<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
内容内容内容内容内容内容内容<br />
</div>
<asp:Button ID="btnPrint" runat="server" Text="打印" OnClientClick="return PrintArticle();" />
</form>
</body>
</html>
<script type="text/javascript">
function PrintArticle() {
var pc = document.getElementById("<%=PrintContent.ClientID%>");
var pw = window.open('', '', 'width=500,height=400'); pw.document.write('<html>');
pw.document.write('<head>'); pw.document.write('<title>ASP.NET网页打印测试</title>'); pw.document.write('</head>');
pw.document.write('<body>'); pw.document.write(pc.innerHTML); pw.document.write('</body>');
pw.document.write('</html>'); pw.document.close();
setTimeout(function () {
pw.print();
}, 500); return false;
}
</script>
相关文章推荐
- web页面打印功能
- web调用本地方法,并实现打印功能(屏幕分辨率导致打印断断续续不清晰)
- WEB打印系列教程之二--使用IE的打印功能进行一般的网页打印
- 10分钟让自己的web页面具有打印功能
- 在Web中如何运用JavaScript实现打印功能
- Web打印解决方案之普通报表打印功能
- WEB打印-网页打印功能(带分页、可多页打印)
- web开发中的打印功能,如何去掉chrome浏览器的页眉页脚
- 借助于repeater实现自动分页的WEB打印功能
- 五种主流web报表工具的功能对比——批量打印
- JS实现Web网页打印功能(IE)
- 关于Web页面打印功能的优化
- JS+调用word打印功能实现在Webfrom客户端
- IE 自带的WEB打印功能-适合通常情况打印
- 有分页功能的WEB打印
- 借助于repeater实现自动分页的WEB打印功能
- jatoolsPrinter实现web打印功能
- 使用Web Datawindow ActiveX实现Web页面的打印功能
- web页面实现指定区域打印功能