printImageBytes static method
Print an image from bytes.
imageBytes: Raw image data as byteswidth: Width to resize the image (0 = printer default)alignment: Image alignment (left, center, right)
Returns true if printing was successful.
Implementation
static Future<bool> printImageBytes(
Uint8List imageBytes, {
int width = 0,
Alignment alignment = Alignment.centerLeft,
}) async {
try {
return await PrinterCore.printImageBytes(
imageBytes,
width: width,
alignment: TextFormatter.convertAlignment(alignment),
);
} catch (e) {
print('Error printing image bytes: $e');
return false;
}
}