ios 设备上图像抖动、热敏打印问题

问题描述 投票:0回答:1

我正在尝试在热敏打印机中打印图像。 android端没有问题,但是ios端打印过程不完整。它只打印图像的一半。

软件包:print_bluetooth_ Thermal、esc_pos_utils_plus、widgets_to_image

enter image description here

final Uint8List? imageBytes = await controller.capture(pixelRatio: 1);
final profile = await CapabilityProfile.load();
final generator = Generator(PaperSize.mm58, profile);

List<int> bytes = [];
bytes += generator.reset();

var image = img.decodeImage(imageBytes);

if (Platform.isIOS) {
      final resizedImage = img.copyResize(image!, width: image.width ~/ 1.3, height: image.height ~/ 1.3, interpolation: img.Interpolation.nearest);
      final byteString = Uint8List.fromList(img.encodeJpg(resizedImage));
      image = img.decodeImage(byteString);
      bytes += generator.imageRaster(image!,align: PosAlign.center);
}else{
      bytes +=generator.imageRaster(image!);
}
bytes += generator.feed(2);

var printing = await PrintBluetoothThermal.writeBytes(bytes);
print(printing); // donot show any message
flutter dart printing thermal-printer
1个回答
0
投票

我也遇到了同样的问题,但还没解决。您对此有任何更新吗?

© www.soinside.com 2019 - 2024. All rights reserved.