zoukankan      html  css  js  c++  java
  • ScriptX实现的打印功能 只兼容IE

    <%@ 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">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <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>
    

      

  • 相关阅读:
    Linux下的压缩zip,解压缩unzip命令具体解释及实例
    编程验证哥德巴赫猜想
    HDU 4735 Little Wish~ lyrical step~(DLX , 反复覆盖)
    The 2013 South America/Brazil Regional Contest 题解
    【 D3.js 高级系列 — 2.0 】 捆图
    怎么让百度收录站点的图片呢?
    ios-UI1
    oc85--利用宏定义简化单例
    oc84--单利
    oc83--自定义类实现copy方法
  • 原文地址:https://www.cnblogs.com/lengv10/p/3682551.html
Copyright © 2011-2022 走看看