【发布时间】:2020-12-24 18:51:29
【问题描述】:
我有使用 android 运行的 Pax A920。 那么如何在java中使用打印服务呢?
【问题讨论】:
-
请联系供应商的支持台。 Terminal — PAX A920
-
供应商没有响应
-
如果没有办法去问处理它的销售公司,似乎没有办法。你只需要等待你认识的人回答。
我有使用 android 运行的 Pax A920。 那么如何在java中使用打印服务呢?
【问题讨论】:
我建议您使用 Neptune api。你可以google pax 920 neptune api demo,出现的第一个链接(https://docs.hips.com/docs/pax-a920)包含一个演示,它显示了所有基本功能(包括打印机),你可以在你的设备上运行它:
在应用程序中,您首先需要一个函数来检索 IDAL:
public static IDAL getDal() {
if(dal == null){ //dal is a private static IDAL variable of the application
try {
dal = NeptuneLiteUser.getInstance().getDal(context);
} catch (Exception e) {}
}
return dal;
}
然后在您的活动中,您可以执行以下操作:
try {
IPrinter printer= MyApp.getDal().getPrinter();
printer.init();
printer.printStr("Your text",null);
printer.start();
} catch (PrinterDevException e) {
e.printStackTrace();
}
【讨论】:
void setFontPath(java.lang.String fontPath)函数吗?
void fontSet(EFontTypeAscii asciiFontType,EFontTypeExtCode fontTypeExtCode) 你尝试给它一个 .ttf 文件的路径吗?不过,如果它适用于任何类型的字体,我会感到惊讶