Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prints large space after printing the receipt #75

Open
A7mdlbanna opened this issue Nov 17, 2022 · 8 comments
Open

Prints large space after printing the receipt #75

A7mdlbanna opened this issue Nov 17, 2022 · 8 comments

Comments

@A7mdlbanna
Copy link

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 );
@geekswamp
Copy link

Same issue.

@A7mdlbanna
Copy link
Author

Same issue.

if you find any solution please let me know

@geekswamp
Copy link

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

@A7mdlbanna
Copy link
Author

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.

@ankush-ppie
Copy link

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

@rafiiAP
Copy link

rafiiAP commented Dec 30, 2022

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

@geekswamp
Copy link

@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

@rafiiAP
Copy link

rafiiAP commented Dec 30, 2022

@arifai oke makasih bang saya coba dulu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants