Hi, I'm using another_brother: ^0.0.34. My printer is QL-820NWB. I'm getting an error that printer settings not supported. Can you let me know what I'm doing wrong. Here is my code :
void printVisitor() async {
try {
var printer = Printer();
var printInfo = PrinterInfo();
printInfo.printerModel = Model.QL_820NWB;
printInfo.printMode = PrintMode.ORIGINAL;
printInfo.isAutoCut = true;
printInfo.port = Port.NET;
printInfo.paperSize = PaperSize.CUSTOM;
printInfo.customPaperWidth = 60;
printInfo.customPaperLength = 100;
// printInfo.binCustomPaper = BinPaper_RJ2050.RD_W58mm;
printInfo.customPaperInfo = CustomPaperInfo.newCustomDiaCutPaper(Model.QL_820NWB, Unit.Mm,
60, 90, 0, 0, 0, 0, 0);
// printInfo.pap
// Set the label type.
printInfo.labelNameIndex = 15;
// Set the printer info so we can use the SDK to get the printers.
await printer.setPrinterInfo(printInfo);
// Get a list of printers with my model available in the network.
List<NetPrinter> printers = await printer.getNetPrinters([Model.QL_820NWB.getName()]);
if (printers.isEmpty) {
// Show a message if no printers are found.
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Padding(
padding: EdgeInsets.all(8.0),
child: Text("No printers found on your network."),
),
));
return;
}
// Get the IP Address from the first printer found.
printInfo.ipAddress = printers.first.ipAddress;
Utils.printLog(message: "Printer found : ${printers.first.ipAddress}");
printer.setPrinterInfo(printInfo);
PrinterStatus status = await printer.printImage(await loadImage());
Utils.printLog(message: "Printer status : ${status.toMap()}");
Utils.printLog(message: "Printer info : ${printInfo.toMap()}");
} catch (e) {
Utils.printLog(message: "Printer Error : ${e.toString()}");
}
}
Hi, I'm using another_brother: ^0.0.34. My printer is QL-820NWB. I'm getting an error that printer settings not supported. Can you let me know what I'm doing wrong. Here is my code :
My printer result :
My printer info :