6 Replies Latest reply on Dec 21, 2017 8:40 AM by Joshua Preston

    Getting strange errors when I try to implement certain methods in the C# SDK

    Joshua Preston

      I am using the example C# code from Zebra Technologies - Card ID Printing – Zebra Card SDK for ZXP Series 3 Printers – C# . The SDK has a very steep learning curve. I am copying some of the code and implementing it in my own application and am running into a few really weird errors:

       

      Unable to Open connection to Zebra ZXP Series 3 USB Card Printer (redirected 3) ERROR = 61

      Printing InitGraphics Error: 65017

      Printing DrawText Error: 8023

      Printing PrintGraphics Error: 65

       

      I'm almost positive all of these errors stem from the first Error. Where can I find a reference sheet for these errors? RWest

        • Re: Getting strange errors when I try to implement certain methods in the C# SDK
          Stephen Troup

          Are you trying to access a printer over a remote desktop / terminal server link or from a virtual machine? As I believe that isn't supported in the SDK, it has to be on the connected directly via usb or via an ethernet connection.

           

          If the code

           

                       object _deviceList = null;

                      ZXPPRINTERLib.Job job = new ZXPPRINTERLib.Job();

                      try

                      {

                          job.GetPrinters(ZXPPRINTERLib.ConnectionTypeEnum.All, out _deviceList);

                      }

                      catch

                      {

                          _deviceList = null;

                      }

           

                      j.Close();

                      do

                              {

                                  Thread.Sleep(10);

                              } while (Marshal.FinalReleaseComObject(j) > 0);

           

          doesn't find it then it won't work.

            • Re: Getting strange errors when I try to implement certain methods in the C# SDK
              Joshua Preston

              You are correct. The SDK does not support "redirected printers" or printers connected via a network. The driver doesn't at least. I had to make a whole separate service that was hosted on the client's computer to receive parameters for the card and then forward it to the client's USB connected Zebra ZXP Series 3. I used SignalR technology with C#

                • Re: Getting strange errors when I try to implement certain methods in the C# SDK
                  Stephen Troup

                  If the printer has the optional ethernet connector then it's possible to connect using that but you need to use the <ip address>:9100 as the connection name rather than the serial number. I've done this with a ZXP7 to 9 printer which works in a similar way.

                   

                  Provided you set it as a fixed IP or give it a dhcp reservation  or use it's dns address from the it's print server than it should work and you wouldn't need to search for it. Plus you wouldn't need to install the printer driver on the client machine or any of the sdk and it also then works on operating systems other than windows - except the website hosting platform but even then you only need the sdk installing.

                   

                  I've got a project at the moment where we load all the ip addresses of the printers into a database table and then let the user select which printer to use. Provided the routing works it will print on the other side of the planet if we needed to.

                   

                  One benefit is you can then use the encoding over ethernet for the pcsc card reader, if it has one, but that's a whole other story. But my zxp3 doesn't have an ethernet port as it's optional as we didn't need it at the time.

                    • Re: Getting strange errors when I try to implement certain methods in the C# SDK
                      Joshua Preston

                      Yeah, unfortunately we will be printing cards on the fly at a event that is independent of our network at home base, and we are using the ZXP3 so it won't make sense for us to use the network printers - plus at this point, the SDK is such a daunting task to work with it's just a waste of time for us. Fortunately I got it working well with the service. The technical documentation is really lacking for the SDK. It needs to be updated and re-written for a more modern 2017 Visual Studios using C#

                       

                      Of course the good news is I got it working, but now I am curious about another issue. Have you been able to send like 30 or 40 print jobs for cards to your printer such that they will print out synchronously with no issues / problems? I'm just curious before I dive into this issue. We want to print about 50-100 cards in one click, so I would probably do a for loop and just constantly send jobs to the ZXP3. With that being said, I

                      'm not sure if the printer will get hung up because it takes about 20-30 seconds to print each card or what.