works fine on 2.3.0 ✔
after upgrade to flutter_bluetooth_printer: ^2.6.3
the api for FlutterBluetoothPrinter.printImage changed
no i have to pass a List<int> instead of image from package image
i tried to use image.getBytes()
the code i use to convert pdf to image
Future<Image> convertPdfUnit8ListToImage(
Uint8List docBytes, [
double? width,
]) async {
final watch = Stopwatch()..start();
final document = await x.PdfDocument.openData(docBytes);
final page = await document.getPage(1);
final image = await page.render(
width: width ?? page.width * 3,
height: page.height * 3,
format: x.PdfPageImageFormat.png,
);
page.close();
final img = decodeImage(image!.bytes.buffer.asUint8List());
watch.stop();
log('it took ${watch.elapsed.inSeconds} Seconds');
if (img != null) return img;
throw Exception('Could not decode image');
}
but the package print a dark image blow i will
before update :
after update and use bytes
works fine on
2.3.0
✔ after upgrade toflutter_bluetooth_printer: ^2.6.3
the api forFlutterBluetoothPrinter.printImage
changed no i have to pass aList<int>
instead of image from packageimage
i tried to use
image.getBytes()
the code i use to convert pdf to image
but the package print a dark image blow i will before update : after update and use bytes