8 Replies Latest reply on Feb 22, 2019 8:37 AM by Dmitry Prokhorov

    VB.net, SDK, connect to ZD420, print/fill out label templates

    Robert Olschewski

      Hello all!


      I just bought a ZD420t label printer that we want to use in our company.

      We already have a printer (other brand) that I can access via an SDK and I've written a VB.net software to load a label file and fill out the variable text fields and also QR codes.


      Now I want to do that using the ZD420t. I've created labels and named the all elements I want to fill out using my VB.net software, installed the zebra.printer.sdk - but how do I open the printer (USB, NOT LAN), load the label and submit the data to the the desired elements?


      I looked at the code examples, but I don't know any C language, I also don't find how to access/connect the USB printer or load a label.

      (the other printer I mentioned had vb.net examples available and it was really easy to achieve results in no time)


      Can anyone point me to the right direction or show me examples of how to do that?

      I've already searched the community, googled for hours, but now  I am kinda desperate


      Many thanks in advance,


        • Re: VB.net, SDK, connect to ZD420, print/fill out label templates
          Dmitry Prokhorov

          Hello Robert,


          Here you can see an FormatUtil Interface usage example that is implemented on C#.Net. Using this example you can implement it in the same way on VB.Net, using same classes and methods. The only thing you need to change is to use UsbConnection class constructor instead of TcpConnection class constructor used in example. Use configured name of your printer as a parameter for UsbConnection class constructor.


          Also, you can use Zebra designer to export your label format to the printer. This way you can use it later with "^XF" ZPL command to print a label.

          Hope it helps.


          Dmitry Prokhorov

          Software Engineer, Kutir Mobility

          Posted on behalf of Zebra Technologies

            • Re: VB.net, SDK, connect to ZD420, print/fill out label templates
              Robert Olschewski

              Hello Dmitry!


              Thanks for your reply!

              Mmmh, like I said, I don't speak C# (I'm not a software engineer, all I know about programming is self-taught), but I think I got the connection part done.

              I guess I have to use the printer name I find in "devices and printer" in the Windows control panel as string and open the connection.


              But in your example I only see labels that have been stored on the printer. Is it possible to load them from a folder that's located on the PC?

              Also, the vars dictionary: I can not use the names of the elements on a label? The element names, for example, are "text1" or "QR_serial".

              I think the integer numbers (11, 12) in the example code relate to the ZPL code (FN11, FN12) and I can not use string element names.


              Loading the .lbl file, replacing the text elements with the actual content and then print is not possible with the SDK?


              We can not store every label on the printer, they need to be on the PC that has the connection to the printer.

              Is there any solution for this?

            • Re: VB.net, SDK, connect to ZD420, print/fill out label templates
              Robin West

              Hi Robert, I can help write some samples, but I'm not sure what kind of label file you have.  Can you share a version?  There are a lot of options for what kind of labels you can print so it would be useful.

                • Re: VB.net, SDK, connect to ZD420, print/fill out label templates
                  Robert Olschewski

                  Hello Robin,


                  thanks you for your reply!

                  Do you see the SAMPLE.LBL in the label examples folder?

                  It looks like







                  Element name of "Sample" is Text1

                  Element name of the barcode is Barcode1


                  For example: I would like to change the word "Sample" of Text1 to "Test!" and also change the value of Barcode1 with values I enter in textboxes in my vb.net program and then print the whole thing.


                  Basically I am replacing a non-Zebra label printer with a ZD420t and now I have to recreate all the labels we use in at my workplace to be able to print them on the new printer (some of them also have logos/images, but these images will not be changed with the vb.net program).

                • Re: VB.net, SDK, connect to ZD420, print/fill out label templates
                  Jeffrey Baker

                  Dmitry, can you direct me to where I can download the SDK that includes the VB.NET DLL library?

                    • Re: VB.net, SDK, connect to ZD420, print/fill out label templates
                      Dmitry Prokhorov

                      Hello Jeffrey,


                      I have installed Link OS SDK on my windows computer and I able to see following files inside of SDK root directory:
















                      windows_mobile_ce\v1.1.123\demos\src\vs2008_solution\DeveloperDemosVisualBasic\My Project\AssemblyInfo.vb

                      windows_mobile_ce\v1.1.123\demos\src\vs2008_solution\DeveloperDemosVisualBasic\My Project\Resources.Designer.vb














                      Those files are samples targeted for WinMobile and WinCE platforms but they are using the same Link OS SDK/API and I suppose they can be used as examples for VB.Net development on Windows PC.


                      Dmitry Prokhorov

                      Software Engineer, Kutir Mobility

                      Posted on behalf of Zebra Technologies