Add base64 signature png to zpl printer object

T Thomas Birkenes 3 years 6 months ago
13 1 0

I have a ZPL object, but I would like to add a users signature to an existing ZPL object/string.
Would anyone know how to achieve this?
This would be for an Android devices.

Please Register or Login to post a reply

1 Replies

T Thomas Birkenes

Found the solution right here if anyone is wondering.
private void printLabelWithImage(Bitmap bitmap, Context context)
{
// The context is the passed in from the calling method
// using getApplicationContext()
Connection conn = new BluetoothLeConnection(nfcMacAddress, context);
try
{
conn.open();
ZebraPrinter zprinter = ZebraPrinterFactory.getInstance(conn);
ZebraImageI zi = ZebraImageFactory.getImage(bitmap);
zprinter.storeImage("E:IMAGE.PNG", zi, zi.getWidth(), zi.getHeight());
Thread.sleep(500);
string label = "^XA~TA000~JSN^LT0^MNM^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD21^JUS^LRN^CI0^XZ" +
"^XA" +
"^MMT" +
"^PW300" +
"^LL3300" +
"^LS0" +
"^FO0,2400" +
"^IME:IMAGE.PNG^FS" + // This is where the image is used.
"^FT70,2395^A0B,67,67^FH\\^FD**patient_name**^FS" +
"^FT121,2288^A0B,42,40^FH\\^FD**birth**^FS" +
"^FT123,2393^A0B,42,40^FH\\^FDDOB:^FS" +
"^FT174,2391^A0B,42,40^FH\\^FDPatient ID:^FS" +
"^FT172,2204^A0B,42,40^FH\\^FD**id**^FS" +
"^BY5,0^FT280,1347^BOB,5,N,0,N,1," +
"^FH\\^FD**barcode**^FS" +
"^PQ1,0,1,Y^XZ");
conn.write(label.getBytes());
Thread.sleep(500);
conn.close();
}
catch (Execption e)
{ e.printStackTrace() }
}

CONTACT
Can’t find what you’re looking for?