再会。
我一直在使用 printBitmap 方法在热敏收据上打印图像,我可以将图像居中或对齐到左侧或右侧,但我无法确定图像的打印位置(它总是打印在收据的顶部)我想要知道是否可以设置坐标以在我想要的位置打印图像。在此先感谢您能给我的任何帮助。这是处理图像打印的代码段:
private void init() {
if (ptr == null) {
if (logger.isTraceEnabled()) {
logger.trace("Init ptr=null portName=" + portName);
ptr = new POSPrinter();
try {
ptr.open(portName);
ptr.addStatusUpdateListener(this);
} catch (JposException e) {
ptr = null;
throw new DeviceServerRuntimeException(ErrorCode.JPOS_PRINTER_ERROR, e);
}
if (logger.isTraceEnabled()) {
logger.trace("Init portName=" + portName);
}
}
}
public void printImage(String pathImage) {
try {
ptr.printBitmap(currentTargetDevice, pathImage, POSPrinterConst.PTR_BM_ASIS, POSPrinterConst.PTR_BM_CENTER);
} catch (JposException e) {
throw new DeviceServerRuntimeException(ErrorCode.JPOS_PRINTER_ERROR, e);
}
}