Closed vivekebiit closed 2 years ago
hey, did you able to print the image? I'm also not able to print images can you share something? thanks
were you able to print pictures?
were you able to print pictures?
Yes I did, but I used flutter blue and esc_pos_utills
Hello, I can print images with the following code:
import 'package:image/image.dart' as img;
import 'package:esc_pos_printer/esc_pos_printer.dart';
import 'package:esc_pos_utils/esc_pos_utils.dart';
...
final NetworkPrinter manager = NetworkPrinter(paperSize, profile);
Future<void> image(Uint8List bytes, {align = PosAlign.center}) {
final img.Image image = img.decodeImage(bytes)!;
final img.Image resized = img.copyResize(image, width: 558);
this.manager.image(resized, align: align);
}
In my opinion, https://github.com/kechankrisna/pos_printer_manager is preferable. Packge is dependent on this package, and for larger images, it is managed.
thanks for the help guys, i got it here
Thanks a lot. needed to add this line for resizing the image.
final img.Image resized = img.copyResize(image, width: 558);
the rest was the same as the package suggested.
I'm not able to print out my images on receipt paper