Problems connecting to printer using C# SDK
I am currently trying to print to a Zebra ZD420-203dpi ZPL printer.
I am trying to print like this:
List discoPrinters = UsbDiscoverer.GetZebraDriverPrinters();
List discoUsbPrinters = UsbDiscoverer.GetZebraUsbPrinters();
printerConnection = discoPrinters.First().GetConnection();
else if (discoUsbPrinters.Any())
printerConnection = discoUsbPrinters.First().GetConnection();
throw new Exception("No USB printer discovered!");
ZebraImageI zebraImage = ZebraImageFactory.GetImage(image);
var printer = ZebraPrinterFactory.GetInstance(printerConnection);
printer.PrintImage(zebraImage, 0, 0, zebraImage.Width, zebraImage.Height, false);
The printer is connected via USB, and as you can see I am using two different approaches for discovering the printer. I don't know what the difference is between the two. The first time I printed, I used the GetZebraDriverPrinters method, but after accidentally uninstalling the printer and reinstalling it, that did not work anymore. Then I found the GetZebraUsbPrinters method, and that works fine for the first print after I have booted my machine (I am running on a Windows 10 VM inside Unraid, where I forwarded the USB port to the VM), but the second time I want to print, I get this error message:
Zebra.Sdk.Printer.ZebraPrinterLanguageUnknownException: 'Unknown printer language'
at Zebra.Sdk.Printer.Internal.ZebraPrinterFactoryHelper.GetLanguage(Connection connection, String cpclFwVersionPrefixes)
at Zebra.Sdk.Printer.ZebraPrinterFactory.GetInstance(Connection connection)
at ProReception.Printer.Zebra.ZebraPrinter.Print(VisitorArrivalMessage message) in C:\Dev\ProReception\ProReception\ProReception.Printer.Zebra\ZebraPrinter.cs:line 68
Can anyone help me figure out why I get this error?
Thanks a lot in advance!
Try to update the firmware of the printer to latest update. here, below where you can download the latest version.
If you are not familiar with the firmware updating process. Please, follow the link below that explains it in detail.
Below the link to do it with Zdownloader.
Once you have updated the printer with latest firmware update. You should verify that the printer is correctly using ZPL printer language.
With Zebra Setup Utilities (you can use either the windows or mobile versions (iOS or Android) to execute this process.
Now, try again to run your program and review if this responds correctly to your application. If additional issues are presented. Please, check the link below for more examples of sample code.