another_brother icon indicating copy to clipboard operation
another_brother copied to clipboard

QL 820NWB ERROR_WRONG_LABEL

Open dustin-auby opened this issue 10 months ago • 1 comments

Hi,

im trying to print to a QL 820NWB printer. the printer is discovered but when i try and print to it i get this error

errorCode: {name: ERROR_WRONG_LABEL, id: -1}

any suggestions on what i should change ?

dustin-auby avatar Apr 25 '24 14:04 dustin-auby

var printer = brother.Printer(); var printInfo = brother.PrinterInfo(); printInfo.printerModel = brother.Model.QL_820NWB; printInfo.printMode = brother.PrintMode.FIT_TO_PAGE; printInfo.isAutoCut = true; printInfo.port = brother.Port.NET; // Set the label type. double width = 100.0; double rightMargin = 0.0; double leftMargin = 0.0; double topMargin = 0.0; CustomPaperInfo customPaperInfo = CustomPaperInfo.newCustomRollPaper(printInfo.printerModel, Unit.Mm, width, rightMargin, leftMargin, topMargin); printInfo.customPaperInfo = customPaperInfo; printInfo.ipAddress = "10.0.2.158"; // printInfo.paperSize = brother.PaperSize.CUSTOM; await printer.setPrinterInfo(printInfo);

dustin-auby avatar Apr 25 '24 14:04 dustin-auby

have you found any solution?

askankit avatar May 13 '24 04:05 askankit

have you found any solution?

Hi, No i have not. i have ended up not printing via the sdk and using the android print service, this is not good though as it prompts the user each time to confirm printing

dustin-auby avatar May 13 '24 09:05 dustin-auby

Hi @dustin-auby ,

Thanks for reaching out about this and apologies for the delayed reply.

The error you are seeing comes from using a CustomPaperInfo to specify the label. In the case of the QL-* printers the label is instead specified using the respective QL paper. You may find a sample printing to the QL-1110NWB here https://github.com/CodeMinion/Demo-Another-Brother-Prime/blob/master/lib/main.dart#L432

CodeLab: https://codelabs.rouninlabs.com/codelabs/another_brother-codelab/index.html?index=..%2F..index#4

The form for the QL-820NWB you have will be the same but use Model.QL_820NWB and the label will come from the QL700 label set (https://github.com/CodeMinion/another_brother/blob/main/lib/label_info.dart#L419) as there is no QL800 set in the SDK as of yet.

Hope it helps, but please don't hesitate to reach out if there is anything else we I can help with,

CodeMinion avatar May 13 '24 12:05 CodeMinion