Which SDK should I use for KR403 Zebra Printer

I am writing a .Net WPF application using C # for a 64-bit Windows 7 platform. My application must communicate with a Zebra KR403 printer connected via USB. My questions may be very simple, but I hope this post helps others who are not familiar with this printer in .Net.

1. Which SDK should I use? It is as simple as adding a DLL to my project and using it? I tried using the Windows CE SDK, but I get a BadImageFormatException exception when ZSDK_API.dll tries to load ZebraUsb.dll. This usually means that the dll was compiled for another platform.

2. Should I use the SDK for printing, or should I use regular .Net print libraries? What are the benefits of two options? For example, if I use .Net libraries for printing, will I still have to use ZBI (the language used to communicate with the printer)?

3. How to get printer status (from paper, media not loaded, etc.)? I found a manual (I had to remove the link, the reputation was not high enough to accommodate more than two links), which explains how to do this in Windows CE or Mobile, but I can not find the equivalent for Windows 7 (normal desktop version).

If someone can help me with these questions, I would really appreciate it, and I will post my final solution (or the basic code needed to execute above) here so that others can use.

Thanks in advance for any help.

UPDATE:

I found a code that allows me to communicate directly with the printer via USB: http://danielezanoli.blogspot.com/2010/06/usb-communications-with-zebra-printers.html

I also found a guide for hardware integrators for the KR403 printer that explains the result of the ~ HQES command here: https://support.zebra.com/cpws/docs/crawl/UG_Kiosk/KR403_UG.pdf#xml=https://km.zebra .com / kb / index? page = answeropen & type = open & searchid = 1363543831914 & answerid = 16777218 & iqaction = 6 & url = https% 3A% 2F% 2Fsupport.zebra.com% 2Fcpws% 2Fdocs% 2Fcrawl% 2FUG_Kiosk% 2Fp8408f8f8f408f408f408f40f403ff8f403ff8f40340f123ff840f3ff8f40340f123ff840f3ff8f40340f123

Now I can send the ~ HQES command to the printer via USB using the library above or via the serial port using the SerialPort class from .Net. Then I can interpret the result using the hardware integrator guide above and check the status of the printer. Since this is easy enough to do, I'm not going to try to connect the SDK at this point.

+2
source share
4 answers

I played with a Zebra printer a few years ago. To use the Zebra SDK, all you have to do is include the link to the DLL in your project (right-click on the links in visual studio and click "add link", then go to dll). Note. They are now assumed to have .NET assemblies. They did not return that day, but it was difficult to add an interaction code.

As I recall, the main advantage of the SDK (and why I used it) is that it has some built-in label printing capabilities, including things like barcodes. Thus, you can find a separate library for creating barcodes, but the Zebra SDK allows you to simply send a string (or number) and encode it for you and print the barcode.

0
source

Zebra does not currently offer the .NET SDK for the desktop. As you have seen, the Zebra.NET SDK is designed for older Windows CE / Windows Mobile platforms.

Zebra offers the Java SDK. It does not claim to support KR403, but it may take 20 minutes of testing to see if you can integrate it with your project: http://www.zebra.com/us/en/products-services/software/link-os/ link-os-sdk.html .

As already mentioned, the Zebra SDK allows you to reliably check the status, as well as use the functions of the Zebra printer (for example, saving and playing in the printer format, returning to the printer, non-USB connection, etc.) It must run other typical print libraries, as it is designed for use with Zebra printers.

0
source

finnaly found a .dll compatible with C # or VB.net, and you can download it from the zebra website: ZSDK API

ZSDK_API.dll ZebraPlatformUtil.dll

i personnaly check these .dlls over the zebra printer ZT400 LAN, some code is used here:

using ZSDK_API.Comm; using ZSDK_API.ApiException; using ZSDK_API.Printer; public void SendZplOverTcp(String theIpAddress) { try { // Instantiate connection for ZPL TCP port at given address. ZebraPrinterConnection thePrinterConn = new TcpPrinterConnection(theIpAddress, TcpPrinterConnection.DEFAULT_ZPL_TCP_PORT); // Open the connection - physical connection is established here. thePrinterConn.Open(); // This example prints "This is a ZPL test." near the top of the label. String zplData = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ"; // Send the data to printer as a byte array. thePrinterConn.Write(Encoding.Default.GetBytes(zplData)); // Close the connection to release resources. thePrinterConn.Close(); } catch (ZebraPrinterConnectionException e) { // Handle communications error here. MessageBox.Show(e.StackTrace); } } 
0
source

All Articles