ZPLPrinter Emulator SDK for .NET Standard Update – Fixed Text vertical position

A maintenance release was just published for ZPLPrinter Emulator SDK for .NET Standard. The new build contain the following updates:

  • Fixed! Vertical position for texts when using ^FT command.

Assembly File Update

  • Neodynamic.SDK.ZPLPrinter.dll patched to v1.0.19.503

 

You can download and update the product by using the download link which can be found in the license email or in the Download section of our website https://www.neodynamic.com/products/zpl-printer-emulator-sdk/download/

Advertisements

ZPLPrinter Emulator SDK for .NET Standard just released!

We’re very proud to announce our brand new product ZPLPrinter Emulator SDK for .NET Standard

ZPLPrinter Emulator SDK for .NET allows you to Convert, Preview and Render raw ZPL (Zebra Programming Language) commands to PNG, JPG & PDF by writing C# or VB.NET code targeting any .NET Framework, .NET CORE, Legacy ASP.NET MVC & CORE, Xamarin, Mono & Universal Windows Platform (UWP) projects.

ZPLPrinter Emulator SDK works like a Virtual ZPL Printer device by parsing and processing ZPL commands (from String or Streams) generating high quality output by reproducing built-in and resident ZPL fonts for texts and barcodes with high accuracy.

ZPLPrinter Emulator SDK supports international text including Latin, Asian and RTL languages, most of the ZPL barcodes, color ribbon simulation, custom Rotation and many more features!

The following is a screenshot of a Windows App using ZPLPrinter Emulator SDK

ZPLPrinter Emulator SDK for .NET Standard

Color Label Simulation for Ribbon and Background
ZPLPrinter Emulator SDK for .NET Standard - Color Label Simulation

Great ZPL barcodes support
ZPLPrinter Emulator SDK for .NET Standard - Barcode Support

The online demo is a ZPL Viewer sample written in ASP.NET featuring what ZPLPrinter Emulator SDK can do.

ZPLPrinter Emulator SDK for .NET Standard in ASP.NET

Download ZPLPrinter Emulator SDK for .NET Standard to run the sample projects locally and for a custom integration to your own projects.

How to print barcode labels to the default thermal printer of the client machine in ASP.NET with ThermalLabel SDK

In this short article we’ll show you how to print to the default thermal printer of the client machine (a.k.a. client-side printing) without showing any print dialog to the end-user in an ASP.NET scenario by referring to the same scenario stated in our guide about ASP.NET Client-side cross-browser barcode thermal label printing with ThermalLabel SDK

Please read the above guide to learn more about how our client-side barcode thermal printing approach works before trying the following code.

To print to the default printer of the user (at the client machine) and based our code on the same wrote in our ASP.NET Client-side cross-browser barcode thermal label printing with ThermalLabel SDK guide, you should:

  • The first thing to do is to instruct to the user to set up in Windows OS the thermal printer as the default printer in the client machine. The following screenshot is from Windows 7 on which the user has set up the Zebra GK420tprinter as the default printer.
    Setting the default printer on Windows 7

    Note on the Windows Driver for the client printer.

    In this case the user installed the Zebra ZDesigner driver for the printer. However, in most cases the simple “Generic / Text Only” driver that comes with Windows will work just fine too.

  • The ThermalLabel SDK does support both Zebra ZPL and EPL printer languages i.e. on a given ThermalLabel object, you can instruct our product to generate ZPL or EPL commands and send them to the target printer. So the second important thing you need to knowis what kind of language the default client printer does support i.e. if it a ZPL or EPL printer. Some Zebra printer models (like the GK420t) do support both languages in which case you should not be worried about it (by default our SDK generates ZPL commands). However, others like the LP/TLP-2844 or TLP-3842 which only supports EPL should be taken into account.So you should get that info somehow from the client/user if this is a variable factor. In some enterprise scenarios, thing is sometimes simplified as the whole environment could be using the same printer model and then, the printer command language is already known. So please consider this topic when you need to “print to the default client printer”.
  • In addition to know the client printer’s language (ZPL or EPL) you also need to know the printing resolution (DPI) supported by the client printer. Nowadays, Zebra thermal printers come with 203, 300 and 600 dpi. The same method for getting if the client printer is ZPL or EPL capable may be applied for getting the DPI support.
  • So based on the above considerations, we could change the code from our main guide to the following. We know (somehow) that the printer is ZPL-capable and that it has 203 dpi of printing resolution. With that info we can print the label to the default client printer without showing any dialog to the user by modifying the code in the Page_Init event handler of our ASP.NET page to the following:

    For VB code:

    Protected Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
    
            'is this a request for a WebPrintJob handler?
            If Not Request("webPrintJob") Is Nothing Then
                'Create a WebPrintJob obj
                Dim webPj As New WebPrintJob()
    
                'set a ThermalLabel obj
                webPj.ThermalLabel = GenerateBasicThermalLabel()
    
                'Print to the defaul client printer
                  webPj.ShowPrintDialog = False
                  webPj.PrinterSettings = New PrinterSettings()
                  webPj.PrinterSettings.Communication.CommunicationType = CommunicationType.PrinterDriver
                  webPj.PrinterSettings.ProgrammingLanguage = ProgrammingLanguage.ZPL
                  webPj.PrinterSettings.Dpi = 203
                  webPj.PrinterSettings.UseDefaultPrinter = True
    
                'Serialize WebPrintJob and send it back to the client
                'so it can be processed by the TLClientPrint utility
                Response.ContentType = "text/plain"
                Response.Write(webPj.ToString())
                Response.Flush()
                Response.End()
            End If
    
    End Sub
    
    

    For C# code:

    protected void Page_Init(object sender, EventArgs e)
    {
        //is this a request for a WebPrintJob handler?
        if (Request["webPrintJob"] != null)
        {
            //Create a WebPrintJob obj
            WebPrintJob webPj = new WebPrintJob();
    
            //set a ThermalLabel obj
            webPj.ThermalLabel = GenerateBasicThermalLabel();
    
            //Print to the defaul client printer
            webPj.ShowPrintDialog = false;
            webPj.PrinterSettings = new PrinterSettings();
            webPj.PrinterSettings.Communication.CommunicationType = CommunicationType.PrinterDriver;
            webPj.PrinterSettings.ProgrammingLanguage = ProgrammingLanguage.ZPL;
            webPj.PrinterSettings.Dpi = 203;
            webPj.PrinterSettings.UseDefaultPrinter = true;
    
            //Serialize WebPrintJob and send it back to the client
            //so it can be processed by the TLClientPrint utility
            Response.ContentType = "text/plain";
            Response.Write(webPj.ToString());
            Response.Flush();
            Response.End();
        }
    }
    
    

    With that change of the Page_Init event handler, when the user clicks on the “Print Basic Label…” button of the page, the TLClientPrint utility will run and based on the WebPrintJob settings we did, the label should automatically be printed to the client printer without showing any print dialog at all.

If you need further assistance do not hesitate to contact our tech support.