Good day.
I been using the printBitmap method to print an image on a thermal receipt, I can center or align the image to the left or right , but I cannot decide where the image is printing (it always print on the top of the receipt) I wanna know if there is possible to set the coordinates to print the image where I want. Thanks in advance any help you can give me. Here is the segment of the code that handle the image print:
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);
}
}