现在我尝试编写一个使用Epson Java Pos ADK的Java应用程序。
我做了什么: - 安装Java 1.6.0_22 - 安装Java JDK - 安装Eclipse - 安装了Epson Java Pos ADK 1.11.8
然后我使用Com Port Tool尝试了我的打印机,我发送给他十六进制字符,看看是否一切正常。它确实!
然后我开始开发我的应用程序。在jpos.xml
我在Epson Java Pos ADK包中使用了SetupPOS生成器。
我用了几行来从我的应用程序中进行测试打印:
posPrinter = new POSPrinter();
posPrinter.open("##THE_NAME_I_SET_IN_JPOS_XML##");
posPrinter.claim(0);
posPrinter.setDeviceEnabled(true);
posPrinter.printNormal(station, "xxxxxxxxxxxxxxxxxx\n");
posPrinter.cutPaper(0);
posPrinter.release();
posPrinter.setDeviceEnabled(false);
posPrinter.close();
但是这个应用程序的结果是:
jpos.JposException:事实并非如此 初始化。在 jp.co.epson.upos.pntr.CommonPrinterService.checkInitialized(未知 来源)at jp.co.epson.upos.pntr.CommonPrinterService.sendOutputData(未知 来源)at jp.co.epson.upos.pntr.CommonPrinterService.sendOutputData(未知 来源)at jp.co.epson.upos.pntr.CommonPrinterService.executeNormalPrint(未知 来源)at jp.co.epson.upos.pntr.CommonPrinterService.printNormal(未知 来源)at jpos.POSPrinter.printNormal(未知 来源)at 打印机。(Printer.java:146)at Main.main(Main.java:28)
我在两台不同的PC(Vista和XP 32bit)上试用了相同的版本和工具,但它总是一样的。
我还尝试了JavaPos示例测试应用程序和EpsonHealtCheckTool。这个工具也是如此。
不知道还有什么可以尝试,大家都知道这个问题吗?
PS:我的打印机Epson TM-U220A,串行连接似乎有效,因为当我尝试声明打印机而另一个应用程序使用COM端口时,我的应用程序说端口不可用。
感谢。
答案 0 :(得分:1)
我发现了最新的问题:我使用了错误的电缆。
我自己制作,请参阅下面的Epson文档: