使用JSP在POS打印机(EPSON TM-U675POS型)上打印

我在UI上有一个自定义的PRINT RECEIPT按钮,然后单击它,调用以下功能以在EPSON打印机上打印收据。我已经安装了EPSON OPOS ADK,可以直接握手但不能打印使用以下 功能:

The logs states that the device is not getting enabled.
The error pop up coming "After : False".
At last the Result Code as 105.
Could anyone help me please by guiding me as to what wrong I am doing.

Tried writing code to print the receipt but couldn't succeed to even enable the device.

 function printReceipt(myWindow) {
    var myData = myWindow.myData;   
    printLDN = "POSPRTR";
    alert("inside printReceipt:");
    self.POSPrint1 =  new activeXObject("OPOS.POSPrinter");
    resultCode = self.POSPrint1.Open(printLDN);    
    if (!(resultCode == 0)) {
             myWindow.opener.top.main.showErrorMessage(11,97010,null,myWindow);         
         }
    alert("Before"+self.POSPrint1.DeviceEnabled );
    self.POSPrint1.DeviceEnabled = "true";
    alert("After"+self.POSPrint1.DeviceEnabled );
    resultCode = self.POSPrint1.Claim(1000);
    if (!(resultCode == 0)) {         
         alert("cannot be claimed...");
    }    
    alert(self.POSPrint1.DeviceEnabled );
    var printerStation = 2;
    var feedLines = self.POSPrint1.ReclinesToPaperCut;
    var printData = myWindow.self.receiptText;
    printData += "\x1b" + "|" + feedLines + "lF" + "\n"; 
    resultCode = self.POSPrint1.PrintNormal(printerStation,printData);
    if (!(resultCode == 0)) {
        alert("Result Code:"+resultCode);
    }
    resultCode = self.POSPrint1.Close();
}

在POS打印机上打印所需的帮助

snowd_rop 回答:使用JSP在POS打印机(EPSON TM-U675POS型)上打印

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3163309.html

大家都在问