
	 var printparamsJsonArray  = [];
	 var url = "http://127.0.0.1:888/postek/print";
// 动态链接库CDFPSK.dll中的方法.
	 function OpenPort(px){
	printparamsJsonArray.push({"OpenPort" : px});
	} // 打开通讯端口

	function ClosePort(){
	 printparamsJsonArray.push({"ClosePort" : ""});
	 } // 关闭使用 OpenPort函数打开的通讯端口

	function SetPCComPort(BaudRate,HandShake){
		
		 printparamsJsonArray.push({"SetPCComPort":BaudRate+","+HandShake});
	}

	function PTK_GetErrState(){
		
		printparamsJsonArray.push({"PTK_GetErrState":""});
	}
	function PTK_GetInfo(){
		
		printparamsJsonArray.push({"PTK_GetInfo":""});
	}

	function PTK_ClearBuffer(){
		
		printparamsJsonArray.push({"PTK_ClearBuffer":""});
	}// 清除打印机缓冲内存的容

	function PTK_SetDarkness(id){
		
		printparamsJsonArray.push({"PTK_SetDarkness":id});
	} // 设置打印头发热温度

	function PTK_SetPrintSpeed(px){
		
		printparamsJsonArray.push({"PTK_SetPrintSpeed":px});
	} // 设置打印速度

	function PTK_SetLabelHeight(lheight,gapH,gapOffset,bFlag){
		
		printparamsJsonArray.push({"PTK_SetLabelHeight":lheight+","+gapH+","+gapOffset+","+bFlag});
	}// 设置标签的高度和定位间隙 \黑线 \穿孔的高度。

	function PTK_SetLabelWidth(lwidth){
		
		printparamsJsonArray.push({"PTK_SetLabelWidth":lwidth});
	} // 设置标签的宽度。

	function PTK_SetDirection(direct){
		
		printparamsJsonArray.push({"PTK_SetDirection":direct});
	}

	function PTK_SetCoordinateOrigin(px,py){
		
		printparamsJsonArray.push({"PTK_SetCoordinateOrigin":px+","+py});
	}

	function PTK_PrintLabel(Number,cpnumber){
		
		printparamsJsonArray.push({"PTK_PrintLabel":Number+","+cpnumber});
	} // 命令打印机执行工作

	function PTK_DrawText(px,py,pdirec,pFont,pHorizontal,pVertical,ptext,pstr){
		
		printparamsJsonArray.push({"PTK_DrawText":px+","+py+","+pdirec+","+pFont+","+pHorizontal+","+pVertical+","+ptext+","+pstr});
	} // 打印一行文本字

	function PTK_DrawTextEx(px,py,pdirec,pFont,pHorizontal,pVertical,ptext,pstr,varible){
		
		printparamsJsonArray.push({"PTK_DrawTextEx":px+","+py+","+pdirec+","+pFont+","+pHorizontal+","+pVertical+","+ptext+","+pstr+","+varible});
	} // 打印一行文本文字，内容可以是常量、序列号变或组合符串。

	function PTK_DrawTextTrueTypeW(x,y,FHeight,FWidth,FType,Fspin,FWeight,FItalic,FUnline,FStrikeOut,id_name,data){
		
		printparamsJsonArray.push({"PTK_DrawTextTrueTypeW":x+","+y+","+FHeight+","+FWidth+","+FType+","+Fspin+","+FWeight+","+FItalic+","+FUnline+","+FStrikeOut+","+id_name+","+data});
	} // 打印一行 TrueTypeFont文字，并且宽度和高可以微调

	function PTK_DrawBarcode(px,py,pdirec,pCode,pHorizontal,pVertical,pbright,ptext,pstr){
		
		printparamsJsonArray.push({"PTK_DrawBarcode":px+","+py+","+pdirec+","+pCode+","+pHorizontal+","+pVertical+","+pbright+","+ptext+","+pstr});
	} // 打印一个条码。

	function PTK_DrawBarcodeEx(px,py,pdirec,pCode,NarrowWidth,pHorizontal,pVertical,pbright,ptext,pstr,Varible){
		
		printparamsJsonArray.push({"PTK_DrawBarcodeEx":px+","+py+","+pdirec+","+pCode+","+NarrowWidth+","+pHorizontal+","+pVertical+","+pbright+","+ptext+","+pstr+","+Varible});
	} // 打印一个条码。

	function PTK_DrawBar2D_DATAMATRIX(x,y,w,h,o,m,pstr){
		
		printparamsJsonArray.push({"PTK_DrawBar2D_DATAMATRIX":x+","+y+","+w+","+h+","+o+","+m+","+pstr});
	} // 打印DataMatrix二维条码

	function PTK_DrawBar2D_QR(x,y,w,v,o,r,m,g,s,pstr){
		
		printparamsJsonArray.push({"PTK_DrawBar2D_QR":x+","+y+","+w+","+v+","+o+","+r+","+m+","+g+","+s+","+pstr});
	} // 打印一个 QR 条码

	function PTK_DrawBar2D_QREx(x,y,o,r,g,s,v,id_name,pstr){
		
		printparamsJsonArray.push({"PTK_DrawBar2D_QREx":x+","+y+","+o+","+r+","+g+","+s+","+v+","+id_name+","+pstr});
	} // 打印一个 QR

	function PTK_DrawBar2D_MaxiCode(x,y,m,u,pstr){
		
		printparamsJsonArray.push({"PTK_DrawBar2D_MaxiCode":x+","+y+","+m+","+u+","+pstr});
	}

	function PTK_DrawBar2D_Pdf417(x,y,w,v,s,c,px,py,r,l,t,o,pstr){
		
		printparamsJsonArray.push({"PTK_DrawBar2D_Pdf417":x+","+y+","+w+","+v+","+s+","+c+","+px+","+py+","+r+","+l+","+t+","+o+","+pstr});
	} // 打印一个

	function PTK_DrawBar2D_HANXIN(x,y,w,v,o,r,m,g,s,pstr){
		
		printparamsJsonArray.push({"PTK_DrawBar2D_HANXIN":x+","+y+","+w+","+v+","+o+","+r+","+m+","+g+","+s+","+pstr});
	} // 打印一个汉信码二维条码

	function PTK_PcxGraphicsList(){
		
		printparamsJsonArray.push({"PTK_PcxGraphicsList":""});
	}

	function PTK_PcxGraphicsDel(pid){
		
		printparamsJsonArray.push({"PTK_PcxGraphicsDel":pid});
	} // 删除存储在 打印机 RAM或 FLASH存储器里的一个或所有图形

	function PTK_PcxGraphicsDownload(pcxname,pcxpath){
		
		printparamsJsonArray.push({"PTK_PcxGraphicsDownload":pcxname+","+pcxpath});
	} // 存储一个 PCX格式的图形到打印机

	function PTK_DrawPcxGraphics(px,py,gname){
		
		printparamsJsonArray.push({"PTK_DrawPcxGraphics":px+","+py+","+gname});
	} // 打印指定的图形

	function PTK_PrintPCX(px,py,filename){
		
		printparamsJsonArray.push({"PTK_PrintPCX":px+","+py+","+filename});
	}// 函数是打印一个 函数是打印一个 PCXPCXPCX格式的图形。

	function PTK_BmpGraphicsDownload(pcxname,pcxpath,iDire){
		
		printparamsJsonArray.push({"PTK_BmpGraphicsDownload":pcxname+","+pcxpath+","+iDire});
	}

	function PTK_BinGraphicsList(){
		
		printparamsJsonArray.push({"PTK_BinGraphicsList":""});
	}

	function PTK_BinGraphicsDel(pid){
		
		printparamsJsonArray.push({"PTK_BinGraphicsDel":pid});
	}
		//byte[] Gdata
	function PTK_BinGraphicsDownload(name,pbyte,pH, Gdata){
		
		printparamsJsonArray.push({"PTK_BinGraphicsDownload":name+","+pbyte+","+pH+","+Gdata});
	}

	function PTK_RecallBinGraphics(px,py,name){
		
		printparamsJsonArray.push({"PTK_RecallBinGraphics":px+","+py+","+name});
	}
 		//byte[] Gdata
	function PTK_DrawBinGraphics(px,py,pbyte,pH,Gdata){
		
		printparamsJsonArray.push({"PTK_DrawBinGraphics":px+","+py+","+pbyte+","+pH+","+Gdata});
	}

	function PTK_DrawRectangle(px,py,thickness,pEx,pEy){
		
		printparamsJsonArray.push({"PTK_DrawRectangle":px+","+py+","+thickness+","+pEx+","+pEy});
	} // 画矩形

	function PTK_DrawLineXor(px,py,pbyte,pH){
		
		printparamsJsonArray.push({"PTK_DrawLineXor":px+","+py+","+pbyte+","+pH});
	}

	function PTK_DrawLineOr(px,py,pLength,pH){
		
		printparamsJsonArray.push({"PTK_DrawLineOr":px+","+py+","+pLength+","+pH});
	} // 画直线 (两直线相交处作”或”处理 )。

	function PTK_DrawDiagonal(px,py,thickness,pEx,pEy){
		
		printparamsJsonArray.push({"PTK_DrawDiagonal":px+","+py+","+thickness+","+pEx+","+pEy});
	}

	function PTK_DrawWhiteLine(px,py,plength,pH){
	
		printparamsJsonArray.push({"PTK_DrawWhiteLine":px+","+py+","+plength+","+pH});
	}

	function PTK_SoftFontList(){
		
		printparamsJsonArray.push({"PTK_SoftFontList":""});
	}

	function PTK_SoftFontDel(pid){
		
		printparamsJsonArray.push({"PTK_SoftFontDel":pid});
	}

	function PTK_FormList(){
		
		printparamsJsonArray.push({"PTK_FormList":""});
	}

	function PTK_FormDel(pid){
		
		printparamsJsonArray.push({"PTK_FormDel":pid});
	} // 删除存储在打印机里的一个或所有表格

	function PTK_FormDownload(pid){
		
		printparamsJsonArray.push({"PTK_FormDownload":pid});
	} // 存储一个表格到打印机； 此命令与 此命令与 PTK_FormEnd 函数配对使用。

	function PTK_FormEnd(){
		
		printparamsJsonArray.push({"PTK_FormEnd":""});
	} // 结束存储表格 (Form)，此函数与 PTK_FormDownload配对使用

	function PTK_ExecForm(pid){
		
		printparamsJsonArray.push({"PTK_ExecForm":pid});
	} // 运行指定的表格

	function PTK_DefineCounter(id,maxNum,ptext,pstr,pMsg){
		
		printparamsJsonArray.push({"PTK_DefineCounter":id+","+maxNum+","+ptext+","+pstr+","+pMsg});
	} // 定义一个序列号变量

	function PTK_DefineCounter(id,maxNum,ptext,pstr,pMsg){
		
		printparamsJsonArray.push({"PTK_DefineCounter":id+","+maxNum+","+ptext+","+pstr+","+pMsg});
	}

	function PTK_DefineVariable(pid,pmax,porder,pmsg){
		
		printparamsJsonArray.push({"PTK_DefineVariable":pid+","+pmax+","+porder+","+pmsg});
	}

	function PTK_Download(){
		
		printparamsJsonArray.push({"PTK_Download":""});
	} // 下载变量或系列号变量

	function PTK_DownloadInitVar(pstr){
		
		printparamsJsonArray.push({"PTK_DownloadInitVar":pstr});
	} // 初始化变量或系列号变量

	function PTK_PrintLabelAuto(Number,cpnumber){
		
		printparamsJsonArray.push({"PTK_PrintLabelAuto":Number,cpnumber});
	}

	function PTK_SendFile(FilePath){
		
		printparamsJsonArray.push({"PTK_SendFile":FilePath});
	}

	function PTK_GetUSBID(USBDeviceSerial){
		
		printparamsJsonArray.push({"PTK_GetUSBID":USBDeviceSerial});
	}

	function PTK_DisableBackFeed(){
		
		printparamsJsonArray.push({"PTK_DisableBackFeed":""});
	}

	function PTK_EnableBackFeed(distance){
		
		printparamsJsonArray.push({"PTK_EnableBackFeed":distance});
	}

	function PTK_PrintConfiguration(){
		
		printparamsJsonArray.push({"PTK_PrintConfiguration":""});
	}

	function PTK_SetPrinterState(state){
		
		printparamsJsonArray.push({"PTK_SetPrinterState":state});
	}

	function PTK_DisableErrorReport(){
		
		printparamsJsonArray.push({"PTK_DisableErrorReport":""});
	}

	function PTK_EnableErrorReport(){
		
		printparamsJsonArray.push({"PTK_EnableErrorReport":""});
	}

	function PTK_EnableFLASH(){
		
		printparamsJsonArray.push({"PTK_EnableFLASH":""});
	}

	function PTK_DisableFLASH(){
		
		printparamsJsonArray.push({"PTK_DisableFLASH":""});
	}

	function PTK_FeedMedia(){
		
		printparamsJsonArray.push({"PTK_FeedMedia":""});
	}

	function PTK_MediaDetect(){
		
		printparamsJsonArray.push({"PTK_MediaDetect":""});
	}

	function PTK_CutPage(page){
		
		printparamsJsonArray.push({"PTK_CutPage":page});
	}

	function PTK_CutPageEx(page){
		
		printparamsJsonArray.push({"PTK_CutPageEx":page});
	}

	function PTK_FeedBack(){
		
		printparamsJsonArray.push({"PTK_FeedBack":""});
	}

	function PTK_Reset(){
		
		printparamsJsonArray.push({"PTK_Reset":""});
	}

	function PTK_ErrorReport(wPort,rPort,BaudRate,HandShake,TimeOut){
		
		printparamsJsonArray.push({"PTK_ErrorReport":wPort+","+rPort+","+BaudRate+","+HandShake+","+TimeOut});
	}

	function PTK_ErrorReportUSB(USBport){
		
		printparamsJsonArray.push({"PTK_ErrorReportUSB":USBport});
	} // 发送错误查询指令到打印机并且指定USB端口接收和分析打印机当前错误代码。

	function PTK_RWRFIDLabel(nRWMode,nWForm,nStartBlock,nWDataNum,nWArea,pstr){
		
		printparamsJsonArray.push({"PTK_RWRFIDLabel":nRWMode+","+nWForm+","+nStartBlock+","+nWDataNum+","+nWArea+","+pstr});
	} // 读写RFID标签。

	function PTK_SetRFIDLabelRetryCount(nRetryCount){
		
		printparamsJsonArray.push({"PTK_SetRFIDLabelRetryCount":nRetryCount});
	}

	function PTK_SetRFLabelPWAndLockRFLabel(nOperationMode,OperationnArea,pstr){
		
		printparamsJsonArray.push({"PTK_SetRFLabelPWAndLockRFLabel":nOperationMode+","+OperationnArea+","+pstr});
	}// 设置RFID标签密码和锁定RFID标签

	function PTK_SetRFID(nReservationParameters,nReadWriteLocation,ReadWriteArea,nMaxErrNum,nErrProcessingMethod){
		
		printparamsJsonArray.push({"PTK_SetRFID":nReservationParameters+","+nReadWriteLocation+","+ReadWriteArea+","+nMaxErrNum+","+nErrProcessingMethod});
	}

	function PTK_SetFontGap(gap){
		
		printparamsJsonArray.push({"PTK_SetFontGap":gap});
	}

	function PTK_SetBarCodeFontName(Name,FontW,FontH){
		
		printparamsJsonArray.push({"PTK_SetBarCodeFontName":Name+","+FontW+","+FontH});
	}

	function PTK_RenameDownloadFont(StoreType,Fontname,DownloadFontName){
		
		printparamsJsonArray.push({"PTK_RenameDownloadFont":StoreType+","+Fontname+","+DownloadFontName});
	}

	function PTK_SetCharSets(BitValue,CharSets,CountryCode){
		
		printparamsJsonArray.push({"PTK_SetCharSets":BitValue+","+CharSets+","+CountryCode});
	}

	/* PTK_ReadRFTagData( wPort,rPort,BaudRate,HandShake,TimeOut,nDataBlock,
			 nRFPower,bFeed,strRFData){
		
		printparamsJsonArray.push({"":""});
	}

	 PTK_ReadRFTagDataUSB( usbPort,nDataBlock,nRFPower,bFeed,strRFData){
		
		printparamsJsonArray.push({"":""});
	}

	 PTK_ReadRFTagDataUSB( usbPort,nDataBlock,nRFPower,bFeed, [] strRFData){
		
		printparamsJsonArray.push({"":""});
	}
*/
			//Pointer strRFData
	function PTK_ReadRFTagDataUSB(usbPort,nDataBlock,nRFPower,bFeed){
		
		//data.push({"PTK_ReadRFTagDataUSB":usbPort+","+nDataBlock+","+nRFPower+","+bFeed+",$acceptMsg$"});
        	var data = {};
             data.reqParam = "4";
        	data.lang = "zh";
        	
        	var rDf = {};
			//printparamsJsonArray.PTK_ErrorReportUSB ="255";
			rDf.PTK_ReadRFTagDataUSB =usbPort+","+nDataBlock+","+nRFPower+","+bFeed+",$acceptMsg$";
        	data.printparams = '['+JSON.stringify(rDf)+']';
        	
        	$.ajax({ 
        		type: "POST",
        		url: url,
        		data:data,
        		async:false,
        		dataType:"json",
                timeout:5000, // in milliseconds
                success:function(result){
            		//var retdata = JSON.parse (result);
            		if (result.retval == '0') {
            			var acceptMsg = "";
           			 	for(var retTemp in result){
                        	if(retTemp != "retval" && retTemp != "msg"){
                        		acceptMsg += retTemp+":"+result[retTemp]+";";
                        	}
                        }
           			 	alert(acceptMsg);
            			return acceptMsg;
                    } else {
                    	alert("读取失败，返回结果："+result.retval);
                    }
            	  },
            	 error:function() { 
	        		 alert("请求失败，请检查参数是否正确或打印服务时候开启");
        	  	}
        	});
        	
        	
        
	}

	/* PTK_ReadRFTagDataUSB( usbPort,nDataBlock,nRFPower,bFeed, byte[] strRFData){
		
		printparamsJsonArray.push({"":""});
	}

	 PTK_ReadRFTagDataUSB( usbPort,nDataBlock,nRFPower,bFeed,strRFData){
		
		printparamsJsonArray.push({"":""});
	}
	
*/
	/*
	 * 从指定TCP/IP端口发送读取RFID标签数据指令到打印机并接收打印机当前读取的RFID标签信息。
	 @param  IPAddress： 打印机IP地址.
     @param  Port：      打印机网络端口.
	 @param  nDataBlock：选择数据区域{
		
		printparamsJsonArray.push({"":""});
	} 0: TID , 1: EPC , 2: TID+EPC.
 	 @param  nRFPower： 设置读功率{
		
		printparamsJsonArray.push({"":""});
	}范围: 0 ~ 30dBm；设置为0时，采用系统默认23dBm读取功率{
		
		printparamsJsonArray.push({"":""});
	}
     @param  bFeed：     读取后是否向前走一张标签{
		
		printparamsJsonArray.push({"":""});
	} 
             1：向前走一张标签有效，
             0：向前走一张标签无效。
	 @param  strRFData：  用于存储获取RFID标签数据信息。
*/
	function PTK_ReadRFTagDataNet(IPAddress,Port,nFeedbackPort,nRFPower,bFeed,strRFData){
		
		printparamsJsonArray.push({"PTK_ReadRFTagDataNet":IPAddress+","+Port+","+nFeedbackPort+","+nRFPower+","+bFeed+","+strRFData});
	}
	
	

	function PTK_Connect(IPAddress,Port){
		
		printparamsJsonArray.push({"PTK_Connect":IPAddress,Port});
	}

	function   PTK_CloseConnect(){
		
		printparamsJsonArray.push({"PTK_CloseConnect":""});
	}
	   //byte[] p
 /*   function PTK_GetPrinterName(p){
		
		printparamsJsonArray.push({"PTK_GetPrinterName":p});
	}
    */
    
    //高频RFID
    /*
     * 读写高频RFID标签*/
    function PTK_RWHFLabel(ptext,nStartBlock,nBlockNum,pstr,Varible){
		
		printparamsJsonArray.push({"PTK_RWHFLabel":ptext+","+nStartBlock+","+nBlockNum+","+pstr+","+Varible});
	}
    
    //设置高频RFID 标签。
    function PTK_SetHFRFID(pWForm,nProtocolType,nMaxErrNumd){
		
		printparamsJsonArray.push({"PTK_SetHFRFID":pWForm+","+nProtocolType+","+nMaxErrNumd});
	}
    
    //从指定串口接收打印机当前读取的高频RFID标签信息。Pointer strRFData
    function PTK_ReadHFTagData(wPort,rPort,BaudRate,HandShake,TimeOut,nStartBlock,nBlockNum,pFeed,strRFData){
		
		printparamsJsonArray.push({"PTK_ReadHFTagData":wPort+","+rPort+","+BaudRate+","+HandShake+","+TimeOut+","+nStartBlock+","+nBlockNum+","+pFeed+","+strRFData});
	}

    //从指定USB端口发送读取高频RFID标签数据指令到打印机并接收打印机当前读取的RFID标签信息。Pointer strRFData
    function PTK_ReadHFTagDataUSB(usbPort,nStartBlock,nBlockNum,pFeed){
		
		//printparamsJsonArray.push({"PTK_ReadHFTagDataUSB":usbPort+","+nStartBlock+","+nBlockNum+","+pFeed+","+strRFData});
        	var data = {};
        	data.reqParam = "4";
        	data.lang = "zh";
        	var prd= {};
			
			prd.PTK_ReadHFTagDataUSB=usbPort+","+nStartBlock+","+nBlockNum+","+pFeed+",$acceptMsg$";
        	data.printparams = '['+JSON.stringify(prd)+']';
        	
        	$.ajax({
        		type: "POST",
        		url: url,
        		data:data,
        		dataType:"json",
        		async:false,
                timeout:5000, // in milliseconds
                success:function(result){
            		//var retdata = JSON.parse (result);
            		if (result.retval == '0') {
            			var acceptMsg = "";
           			 	for(var retTemp in result){
                        	if(retTemp != "retval" && retTemp != "msg"){
                        		acceptMsg += retTemp+":"+result[retTemp]+";";
                        	}
                        }
           			 	alert(acceptMsg)
            			return acceptMsg;
                    } else {
                    	alert("发送失败，返回结果："+result.retval);
                    }
            	  },
            	 error:function() { 
	        	 alert("请求失败，请检查参数是否正确或打印服务时候开启");	 
        	  	}
        	});
        
	}
    
    //从指定串口接收打印机当前读取取的高频RFID标签UID信息。Pointer strRFData
    function PTK_ReadHFTagUID(wPort, rPort,BaudRate,HandShake,TimeOut,pFeed,strRFData){
		
		printparamsJsonArray.push({"PTK_ReadHFTagUID":wPort+","+rPort+","+BaudRate+","+HandShake+","+TimeOut+","+pFeed+","+strRFData});
	}
    
    //从指定USB端口发送读取高频RFID标签数据指令到打印机并接收打印机当前读取的RFID标签UID信息.Pointer strRFData
    function PTK_ReadHFTagUIDUSB(usbPort, pFeed){
		
	//	printparamsJsonArray.push({"PTK_ReadHFTagUIDUSB":usbPort+","+pFeed+","+strRFData});
	
        
        	var data = {};
        	//data.printname = $("#printname").val();
        	data.printlabel = $("#printlabel").val();
        	data.reqParam = "4";
        	data.lang = "zh";
        	
        	var printparamsJsonArray  = {};
			printparamsJsonArray.PTK_ReadHFTagUIDUSB=usbPort+","+pFeed+",$acceptMsg$";
        	data.printparams = '['+JSON.stringify( printparamsJsonArray )+']';
        	
        	$.ajax({
        		type: "POST",
        		url: url,
        		data:data,
        		dataType:"json",
                timeout:5000, // in milliseconds
                success:function(result){
            		//var retdata = JSON.parse (result);
            		if (result.retval == '0') {
            			var acceptMsg = "";
           			 	for(var retTemp in result){
                        	if(retTemp != "retval" && retTemp != "msg"){
                        		acceptMsg +=result[retTemp];
                        	}
                        }
           			 	alert(acceptMsg);
            			return acceptMsg;
                    } else {
                    	alert("发送失败，返回结果："+result.retval);
                    }
            	  },
            	 error:function() { 
	        		 alert("请求失败，请检查参数是否正确或打印服务时候开启");
        	  	}
        	});
        
	}
    
    //打印过程中先读取高频标签指定位置块的数据内容，然后打印在标签上面。   注意:  此方法需配合PTK_DrawTextEx 一起使用。
    function PTK_ReadHFTagDataPrintAuto(nStartBlock,nBlockNum){
		
		printparamsJsonArray.push({"PTK_ReadHFTagDataPrintAuto":nStartBlock+","+nBlockNum});
	}
    
  
    
    
    //2019-08-23 新增
    function PTK_Connect_Timer(IPAddress,Port,time) {
    	printparamsJsonArray.push({"PTK_Connect_Timer":IPAddress+","+Port+","+time});
	}
    
   function PTK_AnyGraphicsDownload( pcxname,  filename,  ratio,  width,  height,  iDire){
	   printparamsJsonArray.push({"PTK_AnyGraphicsDownload":pcxname+","+filename+","+ratio+","+width+","+height+","+iDire});
   }
   
   function PTK_AnyGraphicsPrint( x, y, GraphicsName,  filePath,  ratio,  width,  height,  iDire){
	   
	   printparamsJsonArray.push({"PTK_AnyGraphicsPrint":x+","+y+","+GraphicsName+","+filePath+","+ratio+","+width+","+height+","+iDire});
   }
   
    function PRINT(){
        	var data = {};
        	data.reqParam = "1";
        	data.lang = "zh";
          	data.printparams = JSON.stringify( printparamsJsonArray);
         	jQuery.support.cors = true;
        	$.ajax({
        		type: "POST",
        		url: url,
        		data:data,
        		dataType:"json",
        		async:false,
                timeout:5000, // in milliseconds
                success:function(result){
            		//var retdata = JSON.parse (result);
            		if (result.retval == '0') {
            			alert("发送成功！");
                    } else {
                    	alert("发送失败，返回结果："+result.msg);
                    }
            	  },
            	 error:function(request, status, err) { 
        		 alert("请求失败，请检查参数是否正确或打印服务时候开启");
       		   }
        	});
        	
        	printparamsJsonArray=[];
    }
    
     function getPrinterStatus() {
    	 var data = {};
    	 var status="";
        data.reqParam = "1";
     	data.lang = "zh";
     	
     	var getPrinterStatusF = {};
     	getPrinterStatusF.PTK_ErrorReportUSB ="255";
     	data.printparams = '['+JSON.stringify( getPrinterStatusF )+']';
         
     	$.ajax({
     		type: "POST",
     		url: url,
     		data:data, 
     		async:false,
     		dataType:"json",
             success:function(result){
         	
         		 status=result.retval;
         		 
         		console.log("success+"+status);
         		return status;
         	  },
         	 error:function(request, status, err) { 
         	 	console.log("获取状态失败，请重试");
             
    		   },
     	});
     	return status;
	} 
