convertImgtoZpl static method
converts the image to zpl string in the following format
'~DFname
, totalImageBytes
, bytesperRow
, data in hex format
\n'
you can use this image in zpl using the following command
'^FO25,0^XGR:name
,1,1^FS'
Implementation
static Future<String> convertImgtoZpl(
String name, Uint8List imageAsU8) async {
HexImageString tuple = await _getHexBody(imageAsU8);
var body = tuple.hexImage;
//if (compressHex) cuerpo = encodeHexAscii(cuerpo);
return '~DG${name},' +
tuple.totalBytes.toInt().toString() +
"," +
tuple.widthBytes.toInt().toString() +
", " +
body +
"\n";
}