Hi,
I am using the Zebra.Printer SDK to print labels on bluetooth from my Xamarin.Forms iOS app. But I suspect after the printer goes into sleep or after the printer is idle for sometime I always get these two errors:
1. Zebra.Sdk.Printer.ZebraPrinterLanguageUnknownException: Unknown printer language
2. Zebra.Sdk.Comm.ConnectionException: Malformed status response - unable to determine printer status
I have already used the commands to remove the sleep from the printer. I am using Zebra ZD420 . Can anyone help ?
Thanks,
Ashish
Zebra.Printer SDK for Xamarin Issue |
2 Replies
Hi,
Any update on this ?
This is the code snippet I am using to print the labels. Need your inputs promptly.
void Print()
{
Connection connection = null;
try
{
if (selectedPrinter != null)
{
connection = DependencyService.Get().GetBluetoothConnection(printerList[0].Address);
connection.Open();
ZebraPrinter printer = ZebraPrinterFactory.GetInstance(connection);
ZebraPrinterLinkOs linkOsPrinter = ZebraPrinterFactory.CreateLinkOsPrinter(printer);
linkOsPrinter.StoreImage("R:IMAGE.GRF", Picture, 350, 262);
PrinterStatus printerStatus = linkOsPrinter?.GetCurrentStatus() ?? printer.GetCurrentStatus();
string errorMessage = GetPrinterStatusErrorMessage(printerStatus);
if (errorMessage == null)
{
connection.Write(SendZplReceipt(printer.PrinterControlLanguage));
}
else
{
}
}
else
{
}
}
catch (Exception ex)
{
connection?.Close();
Print();
}
finally
{
connection?.Close();
}
}
Hello Ashish,
Are you sure the sleep mode is really off? It looks like the printer goes to the sleep mode and your app can't connect to it.
Have you tried to initiate a new connection after receiving the error? If printer is in the sleep mode, it will automatically wake up when a connection is initiated.
Alexander PalchikovSoftware Engineer, Kutir MobilityPosted on behalf of Zebra Technologies