blue_print_pos icon indicating copy to clipboard operation
blue_print_pos copied to clipboard

Prints large space after printing the receipt

Open A7mdlbanna opened this issue 2 years ago • 8 comments

When I print an invoice it prints more space after the data I want to print (Its size changes with the size of the total printed data)

note: the extra space doesn't exist when I take the HTML code and turn it into an image. and also when I use

Uint8List invoiceImageBytes = await BluePrintPos.contentToImage(content: receiptText.content);

the output is the invoice with borders on the sides (right, bottom) but with no extra space in the invoice.

but when I use my printer this is what it looks like: invoice

could you please tell me how to avoid getting the space or stopping printing after reaching the end of the data?

and here is the code to start printing the invoice:

    await bluePrintPos.printReceiptText(receiptText, feedCount: 0, useRaster: true,paperSize: utils.PaperSize.mm80 );

A7mdlbanna avatar Nov 17 '22 20:11 A7mdlbanna

Same issue.

geekswamp avatar Nov 25 '22 03:11 geekswamp

Same issue.

if you find any solution please let me know

A7mdlbanna avatar Nov 25 '22 10:11 A7mdlbanna

Hi @A7mdlbanna, i found the solution. You can use this package, worked fine for me. And thanks to you @iandis.

geekswamp avatar Nov 29 '22 02:11 geekswamp

Hi @arifai Thanks for your help.

I found a way to work around the bug. I realized that the error is after generating the image with contentToImage function which is from the package itself, so i tried to find another package that takes HTML code to avoid Arabic(rtl) issues.

so i found this package that takes a content of HTML (which i used this package to generate) but prints the invoice without large spacing.

A7mdlbanna avatar Nov 29 '22 18:11 A7mdlbanna

Hello @A7mdlbanna @arifai

Just add this patch in your code or fork this library blue_print_pos. It works for the both platform (Android & iOS) & tested with different thermal printer.

Screenshot 2022-12-25 at 8 31 25 AM

ankush-ppie avatar Dec 25 '22 03:12 ankush-ppie

@arifai sudah nemu solusinya kah bang? terus cara pakai packaeg dari @iandis gimana bang?

rafiiAP avatar Dec 30 '22 02:12 rafiiAP

@arifai sudah nemu solusinya kah bang? terus cara pakai packaeg dari @iandis gimana bang?

Bisa pake cara ini bang:

blue_print_pos:
    git:
      url: https://github.com/iandis/blue_print_pos.git
      ref: refactor/new-bluetooth-package

Tambahin dibagian dependencies. Atau kalo mau pake punya @ankush-ppie caranya sama aja, cuma ganti dibagian url dan ref:

blue_print_pos:
    git:
      url: https://github.com/ankush-ppie/blue_print_pos/tree/master
      ref: master

geekswamp avatar Dec 30 '22 02:12 geekswamp

@arifai oke makasih bang saya coba dulu

rafiiAP avatar Dec 30 '22 02:12 rafiiAP