printImage static method
Print an image from a file path.
imagePath: Path to the image filewidth: Width to resize the image (0 = printer default)alignment: Image alignment (left, center, right)
Returns true if printing was successful.
Implementation
static Future<bool> printImage(
String imagePath, {
int width = 0,
Alignment alignment = Alignment.centerLeft,
}) async {
try {
return await PrinterCore.printImage(
imagePath,
width: width,
alignment: TextFormatter.convertAlignment(alignment),
);
} catch (e) {
print('Error printing image: $e');
return false;
}
}