夢幻之旅

          DEBUG - 天道酬勤

             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            671 隨筆 :: 6 文章 :: 256 評論 :: 0 Trackbacks
          <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
          <HTML>
              
          <HEAD>
              
          </HEAD>
              
          <BODY>
                  
          <script type='text/javascript' language='javascript'>
                              
          function testLabPrint()
                              
          {
                                    
          var personA = new Person(null,null,null,null,null);
                                    
          var personB = new Person(null,null,null,null,null);
                                    labPrint(personA, personB, 
          false);
                      }


                              
          function Person(postCode,addr,compayName,userName,attach)
                              
          {
                                  
          this.postCode="200000";
                                  
          this.addr="中國上海市嘉定區封浜鎮曹安公路15號橋南200米";
                                  
          this.compayName="封浜印刷廠";
                                  
          this.userName="惠萬鵬";
                                  
          this.attach="Mobil:13816360376  QQ:182429125";
                                  
          this.isAlive=false;
                                  
                                  
          //數據的有效性的驗證
                                  if(postCode==null || postCode.length==0//驗證郵編
                                     return;
                                  
          if(addr==null || addr.length==0//驗證地址
                                     return;
                                  
          if(userName==null || userName.length==0//驗證地址
                                     return;

                                  
          this.postCode=postCode;
                                  
          this.addr=addr;
                                  
          this.compayName=compayName;
                                  
          this.userName=userName;
                                  
          this.attach=attach; 
                                  
          this.isAlive=true;
                              }

                               
                      
          function labPrint(perA, perB, isSkip)
                              
          {
                          
          var TSCObj = null;
                          TSCObj 
          = new ActiveXObject("TSCActiveX.TSCLIB");
                          TSCObj.ActiveXopenport (
          "TSC TTP-243E Plus");
                          TSCObj.ActiveXsetup (
          "100","120","4","10","0","2","0");
                          TSCObj.ActiveXsendcommand (
          "SET TEAR ON");
                          TSCObj.ActiveXclearbuffer();
                      
                      
                              
          //ActiveXprinterfont ("開始像素X","開始像素Y","字體高度","旋轉角度","字體風格","下劃線","字體名", "ActiveXdll Test!!");
                              var heightOffset = 405;
                      
          if(!isSkip)
                              
          {
                          TSCObj.ActiveXwindowsfont (
          330 + heightOffset, 403627000"arial", perB.postCode);
                                  TSCObj.ActiveXwindowsfont (
          285 + heightOffset, 403627000"arial", perB.addr);
                                  TSCObj.ActiveXwindowsfont (
          230 + heightOffset, 403627000"arial", perB.compayName);
                                  TSCObj.ActiveXwindowsfont (
          150 + heightOffset, 3203627000"arial",perB.userName);
                                  TSCObj.ActiveXwindowsfont (
          80 + heightOffset, 4003627000"arial", perB.attach);
                              }

                              TSCObj.ActiveXwindowsfont (
          330403627000"arial", perA.postCode);
                              TSCObj.ActiveXwindowsfont (
          285403627000"arial", perA.addr);
                              TSCObj.ActiveXwindowsfont (
          230403627000"arial", perA.compayName);
                              TSCObj.ActiveXwindowsfont (
          1503203627000"arial", perA.userName);
                              TSCObj.ActiveXwindowsfont (
          804003627000"arial", perA.attach);

                      TSCObj.ActiveXprintlabel (
          "1","1");
                      TSCObj.ActiveXcloseport();
                              }

                              
                      testLabPrint();
                      
          </script>
              
          </BODY>
          </HTML>
          posted on 2010-06-03 14:31 HUIKK 閱讀(670) 評論(0)  編輯  收藏 所屬分類: JavaScript
          主站蜘蛛池模板: 绥滨县| 大足县| 洪洞县| 枣强县| 南开区| 台山市| 义乌市| 璧山县| 澎湖县| 太康县| 武隆县| 安塞县| 阿拉尔市| 都兰县| 藁城市| 太保市| 开远市| 襄樊市| 许昌县| 太仆寺旗| 诏安县| 唐海县| 淮阳县| 繁峙县| 红原县| 明溪县| 玛沁县| 南昌市| 蓝田县| 古田县| 旬阳县| 汾阳市| 临武县| 松原市| 莱阳市| 监利县| 安化县| 岑巩县| 游戏| 武威市| 隆尧县|