andrey-ushakov / esc_pos_utils

Basic Flutter/Dart classes for ESC/POS printing
BSD 3-Clause "New" or "Revised" License
147 stars 329 forks source link

Cannot print image full with mm80 paper size #86

Open manucianvy97 opened 2 years ago

manucianvy97 commented 2 years ago

I'm facing issue when printing with image. I cannot print image with full size paper. If print text, it normally. In addition, printing image is interrupted (below image).

E4-F1449-D-9760-4-A73-85-D9-C38-C10834729

DxTa commented 1 year ago

I seems to got similar issue as well. @manucianvy97 have you got any further insight yet?

DxTa commented 1 year ago

Actually, I got it working.

It's quite important to have the image width correct. For me, I capture the screenshot to print and below code is used to represent my idea

Widget bodyPrintWidget(List<List<RowPrinterDetailRes>>? rows) {
    return Container(
        width: Helper.checkPaperSizeIs58mm() ? 360 : 530,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: printInvoiceBitmap(rows),
        )
    );
  }