首页 > 其他 > 详细

ScriptX实现的打印功能

时间:2014-04-23 18:17:38      阅读:667      评论:0      收藏:0      [点我收藏+]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderPrint_From.aspx.cs" Inherits="MouldERP.ChiHZhong.OrderPrint_From" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
    <title>订单打印</title>
    <%--<object id="factory" style="display: none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
        codebase="../js/smsx.cab" viewastext>
       ../js/smsx.cab:是导入的打印包,此处codebase地址要对应上
    </object>--%>
     
    <object id="factory" style="display:none"
    classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
    codebase="smsx.cab" viewastext></object>
 
     
    <script type="text/javascript">
     function PrintTable() {
            $("#div_print").hide();
            doprint();
        }
         
     function doprint() {
      
        factory.printing.header = "";
        factory.printing.footer = "";
        factory.printing.portrait = false; //portrait是指打印方向,设置为true就是纵向,false就是横向。
        factory.printing.leftMargin   = 5   
        factory.printing.topMargin   =   2   
        factory.printing.rightMargin   =   5   
        factory.printing.bottomMargin   =   2
         
        factory.DoPrint(false); //设置为false,直接打印
     }
 
    </script>
    
     
</head>
<body>
    <form id="form1" runat="server">
     
     <div id="div_print" style="margin-top:20px; text-align:center; display:block;">
            <input onclick="PrintTable();" id="PrintHide" type="submit" class="btnSubmitChiH" value="打   印" />
 
     </div>
    </form>
</body>
</html>

  

ScriptX实现的打印功能,布布扣,bubuko.com

ScriptX实现的打印功能

原文:http://www.cnblogs.com/lengv10/p/3682551.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!