12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>打印二维码</title>
- <input id="btnPrint" type="button" value="打印" onclick="javascript:window.print();" />
- <input id="btnPrint" type="button" value="打印预览" onclick=preview(1) />
- <style type="text/css" media=print>
- .noprint{display : none }
- </style>
- <script>
- function preview(oper)
- {
- if (oper < 10)
- {
- bdhtml=window.document.body.innerHTML;//获取当前页的html代码
- sprnstr="<!--startprint"+oper+"-->";//设置打印开始区域
- eprnstr="<!--endprint"+oper+"-->";//设置打印结束区域
- prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18); //从开始代码向后取html
- prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html
- window.document.body.innerHTML=prnhtml;
- window.print();
- window.document.body.innerHTML=bdhtml;
- } else {
- window.print();
- }
- }
- </script>
- <script src="__PUBLIC__/html/jquery-1.11.3.min.js"></script>
- <script>
- jQuery(function($){
- $("#closeButton").click(function(){
- window.close();
- })
- });
- </script>
- </head>
- <body>
- <a id='closeButton' title='Close' href="#" >关闭</a>
- <!-- 打印startprint与endprint之间的内容-->
- <!--startprint1-->
- <div style="margin: 0 auto;text-align: center;width: 60mm; height: 60mm;"><img style="width: 60mm;" src="http://zt-iot.com/ztxf/Public/QRcode/20180202173248-7.png" alt="" /></div>
- <div style="margin: 0 auto;text-align: center;width: 60mm; height: 60mm;"><img style="width: 60mm;" src="http://zt-iot.com/ztxf/Public/QRcode/20180202173248-7.png" alt="" /></div>
- <div style="margin: 0 auto;text-align: center;width: 60mm; height: 60mm;"><img style="width: 60mm;" src="http://zt-iot.com/ztxf/Public/QRcode/20180202173248-7.png" alt="" /></div>
- <!--endprint1-->
- <!-- <div style="margin: 0 auto;text-align: center;width: 60mm; height: 60mm;"><img style="width: 45mm;" src="/ztxf/Public/QRcode/20180118174333-10.png" alt="" />
- <b style="float: left;"> 上海市芙蓉江路533号2楼210室</b></div> -->
- </body>
- </html>
|