johnvuko / flutter_brother_printer

MIT License
11 stars 5 forks source link

Always response "ERROR - ERROR_WRONG_LABEL" after call BrotherPrinter.printPDF () #3

Closed ApiwatProject closed 2 years ago

ApiwatProject commented 2 years ago

My brother print model is PT-P950NW, I don't know why it can't print . Here it is my code to print to brother PT-P950NW

//this is pdf file File? qrCodeLabel;

Future printImage() async { DialogList().loadingDialog(); BrotherDevice? brotherDevice; await BrotherPrinter.searchDevices(searchOnIPv6: true) .whenComplete(() => DialogList().closeLoading()) .then((value) async { print("find printer : ${value.length}"); brotherDevice = value[0]; }); if (brotherDevice != null) { await BrotherPrinter.printPDF( path: qrCodeLabel!.path, device: brotherDevice!, ); } }

johnvuko commented 2 years ago

Hello, Yes it's because your printer required to set the label size, until now it was only possible in this lib for the QL serie (the one I used). I just add label size the PT serie. Can you try to use the master branch and test by passing a BrotherLabelSize parameter and check if it works.

ApiwatProject commented 2 years ago

I use in master branch package and add BrotherLabelSize PT12mm but still error wrong label.

johnvuko commented 2 years ago

Are you sure your paper is 12mm and you're passing the labelSize to printPDF method. I have no other idea about what the problem could be and I cannot find it without the printer.

ApiwatProject commented 2 years ago

In printerSession.java I see only ql series to validate label size but not have tp series. Could you check that please.

johnvuko commented 2 years ago

Sorry I forgot Android. Try again. I have to upgrade to the new version of the SDK for android but it requires a lot of time to rewrite everything.

ApiwatProject commented 2 years ago

It work!!!!!!!!!!!! . Thank for fixing. I appreciate you to make this library. it save a lot of time.

johnvuko commented 2 years ago

I just released a new version 0.1.5.