Closed PromILLEPapst123 closed 5 months ago
Hi @PromILLEPapst123 ,
Thanks for reaching out about this. Could I trouble you to share a bit more details like what code you are currently using to print?
Thanks in advance,
Hi,
i actually tried to fixed it by myself and found a way to do so. When i start my application i list all devices with the usb_serial package. With selecting the printer i also set the printer and printerInfo in a provider to print anywhere while the application is opened. My main problem was that i was alwasy getting the error: Wrong_Label. To fix this problem i did this:
if ((_brotherPrinterAndroid != null) && (_brotherPrinterAndroid!.productName == 'PT-P900W')) { Printer printer = Printer(); PrinterInfo printerInfo = PrinterInfo();
printerInfo.printerModel = Model.PT_P900W;
printerInfo.printMode = PrintMode.FIT_TO_PAPER;
printerInfo.port = Port.USB;
printerInfo.orientation = brother.Orientation.LANDSCAPE;
**printerInfo.labelNameIndex = PT.ordinalFromID(PT.W36.getId());**
printerInfo.labelMargin = 0;
printerInfo.printQuality = PrintQuality.HIGH_RESOLUTION;
printerInfo.isAutoCut = false;
printerInfo.isHalfCut = true;
printerInfo.isCutAtEnd = true;
printerInfo.isCutMark = true;
bool temp = await printer.setPrinterInfo(printerInfo);
/*
await printer.startCommunication();
await printer.endCommunication();
*/
printer.startCommunication();
printer.endCommunication();
return printer;
instead of this:
if ((_brotherPrinterAndroid != null) &&
(_brotherPrinterAndroid!.productName == 'PT-P900W')) {
Printer printer = Printer();
PrinterInfo printerInfo = PrinterInfo();
printerInfo.printerModel = Model.PT_P900W;
printerInfo.printMode = PrintMode.FIT_TO_PAPER;
printerInfo.port = Port.USB;
printerInfo.orientation = brother.Orientation.LANDSCAPE;
**printerInfo.labelNameIndex = PT.W36.getID();**
printerInfo.labelMargin = 0;
printerInfo.printQuality = PrintQuality.HIGH_RESOLUTION;
printerInfo.isAutoCut = false;
printerInfo.isHalfCut = true;
printerInfo.isCutAtEnd = true;
printerInfo.isCutMark = true;
bool temp = await printer.setPrinterInfo(printerInfo);
/*
await printer.startCommunication();
await printer.endCommunication();
*/
printer.startCommunication();
printer.endCommunication();
return printer;
Hello, i'am writing an application where i get an pdf from my api and i safe it in the project folder with the packages "path" and "pathprovider". It works very good so far. Now i have Problems to print on my printer vias usb. The printer is connected via dockingstation to my android tablet. With the "usb_serial" package i get the path of the dev\usb path where the printer is connected. Is there any Option where i can set this path as the path to print for the printer. I searched for Android Java applications and found one example:
Or is there any other solution to fix this problem.