我使用 Citizen POSPrinter 使用蓝牙从我的 android 应用程序打印数字签名。但它只打印打印机中的 byte[] 数组,而不是打印签名。我不知道我错在哪里。帮我。提前致谢..
ESCPOSPrinter posPtr = new ESCPOSPrinter();
String root = Environment.getExternalStorageDirectory().toString();
String fname = "Sign.jpg";
file = new File (root, fname);
path = file.getAbsolutePath();
if (file.exists())
file.delete();
try {
out = new FileOutputStream(file);
signature.compress(Bitmap.CompressFormat.PNG, 90, out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
posPtr.printBitmap("//sdcard//Sign.jpg", CMPPrint.CMP_ALIGNMENT_RIGHT);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();