Skip navigation
1 2 3 Previous Next

Label And Receipt Printing

32 Posts authored by: Robin West Expert

If you are developing apps to print, you know they are easy to write, but hard to get right. Over the years, the Zebra ISV team has tested hundreds of apps and noticed many similar points of failure and poor user experience. The Best Practices are a collection of things to watch out for. The document goes into recommendations for how to develop for these as well as methods to test apps for best user experience when printing.

The updated guide is on our Techdocs site:

Available Product Documentation - Zebra Technologies Techdocs

We will also went through these best practices in detail in the DEV{TALK} on Wednesday Nov 15. See the video here.

The New .NET SDK was not the only recent update. We’ve fixed the bugs and most of the other SDK’s and included these updates on our documentation. The Zebra ISV team has also updated it's Best Practices and includes more clarification around each practice area and basic code snippets showing how to implement many of them.

You can find these documents on Techdocs

.NET developer? Tired of the mobile developers getting all the good stuff?

 

Good News! Zebra just released a .NET SDK for Windows 7, 8.1, and 10 and you’ll find most of the great API's from our Java SDK as well as comprehensive documentation and sample code.  This release includes everything from connection classes for network, USB, and Bluetooth(Windows 10 only), to settings and graphics functions. 

 

  • NEW .NET SDK!
  • iOS developers will find some new functionality in the form of sendAndWaitForResponse methods as well as parameters to fine tune the connection opening and closing methods.  It has also been updated for iOS 10 and 11.
  • Android sample code is now configured for Android Studio, and the PrintStation app has been updated for newer versions of Android.
  • Multiple bugfixes

 

Download the SDKs here!

Robin West

RFID Announcements

Posted by Robin West Expert Aug 29, 2017

RFID has been around for a while and Zebra has always been at the forefront of this technology.  Despite it's great promise, it's been a very slow technology to take off.  Now that IoT has jumped the gap, RFID technology is catching up as a good, inexpensive way to enable unique locationing, a critical part of IoT.  Zebra has recently announced a few new RFID encoding products to market that we thought might fit your solutions.

 

 

If you are developing for RFID, here are some helpful links.  RFID is handled the same way as ZPL and you can use all of the same tools as with standard Zebra Link-OS printers.

RFID Programmers Manual

Link-OS SDK

Link-OS Tools and Utilities

Robin West

Get it on GitHub!

Posted by Robin West Expert Aug 25, 2017

Up until recently we have always shared our printing sample code on the Zebra Support / Knowledge Management site.  Due to popular demand, we have been migrating most of our samples to Github.  In fact, you can find samples and source code for many Zebra products there.  The printing samples are under the name LinkOS-OS-Samples.  Each individual sample is on it's own branch. 

 

Note: We will be shutting down the Knowledge Management site in the next month.  We are working to update links, please keep in mind this is a content migration and be patient with us.  

 

While we were going through our samples we found a few old code snippets.  Here is one of them that some of you might still find useful:

Send ZPL Commands via TCP/IP in VB.net

Confidential and Proprietary

The source code and other information contained herein is the confidential and the exclusive property of ZIH Corp. and is subject to the terms and conditions in your end user license agreement. This source code, and any other information contained herein, shall not be copied, reproduced, published, displayed or distributed, in whole or in part, in any medium, by any means, for any purpose except as expressly permitted under such license agreement.


Copyright ZIH Corp. 2012
ALL RIGHTS RESERVED

Purpose

This application demonstrates how to send ZPL commands to a network  ZPL printer.  It uses TcpClient to accomplish the communication.  It was written in Visual Studio 2008 in C# and tested successfully on a Windows XP machine with Service Pack 3 .

Sample Code

Dim ipAddress As String = "10.3.14.59"

Dim port As Integer = 9100

 

Dim ZPLString As String = _

"^XA" & _

      "^FO50,50" & _

      "^A0N,50,50" & _

      "^FDHello, World!^FS" & _

      "^XZ"

 

Try

      'Open Connection

      Dim client As New System.Net.Sockets.TcpClient

      client.Connect(ipAddress, port)

 

      'Write ZPL String to Connection

      Dim writer As New System.IO.StreamWriter(client.GetStream())

      writer.Write(ZPLString)

      writer.Flush()

 

      'Close Connection

      writer.Close()

      client.Close()

 

Catch ex As Exception

 

      'Catch Exception Here

 

End Try

ZT600.png

The ZT600 Series advances the legacy of the Xi Series printers to combine rugged durability and exceptional performance on a user-friendly, future-ready platform. These next-generation workhorses are designed to help you navigate the rapidly evolving business landscape. So, whether you’re concerned about growing production line demands, increasing operational complexities, integrating disparate systems or controlling investment costs, the ZT600 Series industrial printers have you covered today – and for years to come.

 

Designed to excel even in the harshest of conditions, the newest printers offer greater operational visibility, control and adaptability for the manufacturing and T&L verticals – but are as user-friendly and intuitive as the consumer gadgets we use daily. The ZT600 Series printers' user interface includes an icon menu system with a high-resolution color LCD display. Advanced diagnostics and troubleshooting, including onboard sensors, alarms and error specific how-to videos, help customers identify, diagnose and fix issues quickly, therefore minimizing downtime. These new printers run Link-OS applications designed to streamline device deployment, network connectivity, daily use, and routine maintenance to optimize productivity.

 

Combining rugged physical durability and exceptional performance on user-friendly, future-ready platforms, the new ZT510, ZT610, ZT620 are engineered with the most comprehensive feature set of any Zebra stationary printer. These are the workhorse printers our manufacturing, transportation and logistics customers need to meet business and technology needs now and for years to come.

 

For more information and spec sheets, check out the product pages.

ZT600 Series Industrial Printers | Zebra

ZT510 Industrial Printer | Zebra

 

 

By the time most developers start working on printing, your app is almost complete or you’re fixing an old app.  You can’t figure out why it takes so much code to print something simple like some text or a table.  You are focused on just getting the code done and working so you can get back to the fun code. 

 

This is where I’m going to say wait!  What about the user experience?  This is where you will probably groan why?  Printers are not really part of the app.  They’re separate devices and you don’t have a choice about how they're designed. 

 

Part of user experience is understanding user interactions.  Your end user is interacting with your app, their mobile device or computer, the OS, the printer, the printout, and probably a few other things like a sidewalk or desk. 

 

Is the printer going to next to the user, or somewhere else?  Do you want them looking at your app, the printer or something else while they work?  What is the expected time it will take for the printer to start printing after the “print” button is hit?  Are multiple users going to be using the same printer, or visa versa? What happens if the printer is off or runs out of paper?  Is the printed image quality as good as you want it to be or does it look faint, small, or squiggly?

 

Some of these questions and the issues associated are why we originally created our Best Practices document.  As a start,  this guide will prompt you to consider how the printer should integrate with your UX.

 

Let me know what you think about UX as it relates to peripherals or if you have more questions to ask as a UX designer.

 

Robin West

Solution Architect

Zebra Technologies

Robin West

Printer Web Page

Posted by Robin West Expert Jan 31, 2017

Hi Everyone,

Have you ever thought about a tool that's been around forever and is super handy, but everyone forgets about it?  Did you know that nearly every printer sold by Zebra for over 10 years has its own webpage?  Just plug the printer into a network and pull up your favorite browser, then type in the printer’s IP address into the navigation bar and the printer will show you its webpage.  There are definitely some hidden secrets to this tool as well.

 

Depending on the release date of the printer it may only show a current configuration at first, others may show a menu of options. Most, if you add “/index.html” after the IP address, will show the full menu.  While you can do most of these things in other ways, the webpage is a nice central place to find a lot of these tools together.  It also makes it easier to centralize and share printers in an office or local network.

 

Configuration (/config.html):

If you select the configuration option, you’ll find helpful debug info about the current state of the printer.  For example, if you are printing a receipt and getting a lot more white space at the end of the receipt than you want, check the label length on this page.  You can also view important information such as firmware version. If you are using a mobile printer, you can also check the battery status by entering JUST the IP address of the printer into your browser without anything after it.

 

Settings (/settings):

This page allows you to access and control many of the printer settings from networking to media calibration all through a simple interface. Be careful of restoring defaults as it will wipe all settings back to factory defaults. This may mean that the printer will no longer be able to connect to your network until set up again via USB or serial.

 

Directory Listing (/dir):

This page, when you first look at it, has a straight forward directory listing, so you can check if your file loaded and verify if it was stored correctly along with how much memory you have left to work with. It has a hidden secret though; if you click on a ZPL label file or create a new one (bottom of the listing), you can actually see the ZPL in the file, modify it, and/or get a preview of the printout.  This preview is very accurate as the printer is fully rendering it as it would for printing.  It only works with ZPL formats, but is super useful if you want to make adjustments without reprinting all the time.

 

Alert Setup (/uns):

Did you know your printer can also alert you when something happens like paper out or overheating? This page is one of the ways you can easily set it up to send you or your customer, an email or alert your app without polling .

 

Printer Controls (/control):

Just want a fast way to pause the printer or cancel a batch of prints?  This page has those simple controls.

 

Some menus are password "protected".  You can change it with the ^KP command.  This password only applies to menu items both on a front panel (industrial printers) and on the web-page.  It does not apply to Wi-Fi or other communications. 

To see some of this, my Dev {Talk} from December shows print preview in action.

 

Robin West

Solution Architect

Robin West

Browser Print Update!

Posted by Robin West Expert Jan 27, 2017

Zebra has again expanded and enhanced our Developer Tools with an enhanced release of our Browser Print Developer Tool.   

 

New features for this release:

  • Now supports MAC OSX!
  • Supports Safari Browser
  • Supports Networked printers
  • Convert images (BMP and JPG) to make them printable
  • We added a few more printers to our tested and compatible list

 

Official Announcement:

Developers can now quickly add USB or Network based printing support to their browser-based apps on Windows 7, Windows 10 and Mac OSX systems, when using Internet Explorer v11, Chrome or Safari. The Source Code and documentation that come with Browser Print make adding print capabilities simple and straightforward. We’ve even gone beyond printing to include features that allow Developers to add Device Management capabilities, such status checking, to their apps.

 

Browser Print supports Windows 7, Windows 10 with Internet Explorer v11 or Chrome v51, as  well as OSX with the Safari browser.

The following printer are supported via USB and Network connections:

 QLn series  ZT200 series  ZD500 series  ZD400 series  LP2824+  GK420  GX420

 

Visit https://www.zebra.com/us/en/products/software/barcode-printers/link-os/browser-print.html  for more details and to access our free Browser Print download.

Hello Programmers!  I’m back again with my series on printing from within websites.  This time I’m going to talk about using a client program to print. 

 

The downside is that, until recently, you had to write a client program for every OS you wanted to support with your website.  There is still the possibility that you may want to do that, but there are now several options to serve this need.

 

The benefits of using a client program are that most support multiple connectivity types like USB, Network, and Bluetooth.  They also are now supporting multiple OS's.  Some of these programs are self-contained and handle many aspects of printing including status checking and formatting.  Other programs provide a large amount of control to you as the web developer to handle the entire user experience.  Regardless of which you choose, your website coding to work with these apps is minimal.

 

Zebra has our own app to enable web-based printing called Browser Print.  This first release is for PC and USB connections, but stay tuned as we look into other operating systems, browsers, and connectivity types.  We are providing a JavaScript library and simple sample code to help enable your web apps.  It gives you full bi-directional control of the printer to get status and settings as well as print.

 

If your web app is primarily targeted towards mobile devices, Zebra has several partners with excellent apps that work with your webpages to allow your customers to print.  Sample code is easy to integrate. These apps are designed to take the heavy lifting of handeling the printer off your hands.

MobiPrint by Arrowhead

Centvia by Centrategy

 

 

Earlier Articles on this topic:

Printing from Websites part 1

Printing from Websites part 2

Zebra Web Printing Solutions

 

Robin West

Solution Architect

Zebra Technologies ISV

Connecting to and receiving data from a printer through Web apps has been a very complicated process for developers. Zebra Browser Print makes adding print capabilities to Web-based apps simple and straightforward. Browser Print even enables bi-directional communication between a Web app and printers connected to a PC via local ports, such as USB. This, along with clear documentation and sample code, gives the ability to implement best practices by checking printer status, and making real-time decisions based on the information, conveying that information via the UI.

 

Zebra’s Browser Print allows webpages to communicate with Zebra peripherals connected to a given computer. This allows cloud-based applications to print to virtually any user’s printer. Currently, Browser Print supports the Windows 7 and 10 operating systems, Google Chrome and Internet Explorer browsers, and Zebra printers connected via USB.

 

Learn more and get access to the free Browser Print download.

 

Key Facts

Browser Print:

  • Supports major PC operating systems so your website is more portable.
  • Includes a client app and a JavaScript library to make it easy to integrate into websites.
  • Is bi-directional to allow for status checking and printer setup as well as printing.
  • Is compatible with many Link-OS and ZebraLink printers, including the ZT200 Series, ZD500 Series, ZD400 Series, and the LP2824+ printers.

 

Supporting Quotes

Andrea Betancourt, Development Manager, Servibarras

“The Browser Print driver speeds up the development process because the driver allows you to control the status of the printer without the need to develop complex code. In addition, the driver is able to detect all types of Zebra printers installed on a PC or internal network. This driver makes it easier to configure printers, and at the same time, simplifies software development.”

 

Marcelo Neves, Lead Developer, Nubo Solutions

"Zebra Browser Print helped us to improve our product by allowing it to automatically discover local printers as well as detect and properly handle errors that may occur during the printing process."

 

DEV { TALK } – September 7 - Interested in Connecting a Printer to a Web App?

 

Join our ISV Program to get early access to dev tools and validate your solutions with us like Servibarras ans Nubo Solutions did!

 

Not sure if Browser Print will meet your needs?  Tell us what will!

 

About Servibarras

A Colombian company with 20 years of experience in the graphic arts industry.  Servibarras is committed to offering its customers more value than any other ally, through differentiation by portfolio, quality and service, within a framework of continuous improvement, growth and stable partners and employees, as well as growing relationships with its suppliers. For more information, visit http://www.servibarras.com/.

 

About Nubo Solutions

A Brazilian software company for business automation, which develops and provides flexible products for the most varied vertical retail businesses. An intelligent platform in the cloud, which enables the construction of solutions tailored to your business, whether micro, small or large. The solutions meet special Brazil’s regulations in its different implementations - Fiscal Electronics Consumer Note (NFC-e), SAT Tax and Fiscal Shielded Module (MFB / Convention 09). For more information, visit http://nubo.solutions/.

 

UPDATE: New features have been added recently! Browser Print Update!

Hi Everyone,

We've gotten several requests for some basic sample code for the Link-OS Multiplatform SDK showing it's use with Xamarin.

First, you need to install the SDK, either by downloading it from Zebra.com and following the install instructions, or getting it directly from Nuget. Full API documentation is on Link-OS SDK - Zebra Technologies Techdocs .

 

The sample code creates an app with a text box for entering a printer address and a print button.  When you press the print button, the words "Hello World" print on your Zebra Printer. The address can be an IP address or a Bluetooth MAC address for your printer. 

 

This sample code is for Android, but you can copy the printing portions into an iOS or Forms app without changes.  I gave permissions for BLUETOOTH and BLUETOOTH_ADMIN in the manifest.  As a note, this code will set your printer to ZPL mode, so if you want to your app to print in line mode, you will need to change it back or modify the code.   If you just want to test this code over Bluetooth, you can speed up time to print by changing the connection builder string to connection = ConnectionBuilder.Current.Build("BT:" + address);

 

Happy Coding!

 

MainActivity.cs

/***********************************************

CONFIDENTIAL AND PROPRIETARY

The source code and other information contained herein is the confidential and the exclusive property of

ZIH Corp. and is subject to the terms and conditions in your end user license agreement.

Copyright ZIH Corp. 2016

ALL RIGHTS RESERVED

***********************************************/

using System;

using Android.App;

using Android.Widget;

using Android.OS;

using System.Threading.Tasks;

using LinkOS.Plugin.Abstractions;

using LinkOS.Plugin;

using Android.Util;

using System.Text;

 

namespace BasicPrint

{

    [Activity(Label = "BasicPrint", MainLauncher = true, Icon = "@drawable/icon")]

    public class MainActivity : Activity

    {

        Button button;

        EditText addressTxt;

        const string tag = "BasicPrintApp";

        IConnection connection;

 

        protected override void OnCreate(Bundle bundle)

        {

            base.OnCreate(bundle);

 

            // Set our view from the "main" layout resource

            SetContentView(Resource.Layout.Main);

 

            // Get our button from the layout resource,

            // and attach an event to it

            button = FindViewById<Button>(Resource.Id.MyButton);

            addressTxt = FindViewById<EditText>(Resource.Id.address);

 

            connection = null;

 

            button.Click += delegate {

                Start_Print();

            };

        }

 

        private void Start_Print()

        {

            button.Enabled = false;

            string address = addressTxt.Text;

 

            // Bluetooth communications must be handled on a separate thread and it's

            //    best practice to handle network coms on it as well

            new Task(() =>

            {

                Print(address);

            }).Start();

        }

 

        private void Print(string address)

        {

            string zpl = "^XA^LL200^FO30,20^A0N,30,30^FDHello World^FS^XZ";

 

            try

            {

                if ((connection == null) || (!connection.IsConnected))

                {

                    connection = ConnectionBuilder.Current.Build(address);

                    connection.Open();

                }

                if ((SetPrintLanguage(connection)) && (CheckPrinterStatus(connection)))

                {

                    connection.Write(Encoding.ASCII.GetBytes(zpl));

                }

            }

            catch (Exception e)

            {

                //if the device is unable to connect, an exception is thrown

                Log.Debug(tag, e.ToString());

            }

            finally

            {

                this.RunOnUiThread(() =>

                {

                    button.Enabled = true;

                });

            }

        }

 

        private bool SetPrintLanguage(IConnection connection)

        {

            string setLanguage = "! U1 setvar \"device.languages\" \"zpl\"\r\n\r\n! U1 getvar \"device.languages\"\r\n\r\n";

            byte[] response = connection.SendAndWaitForResponse(Encoding.ASCII.GetBytes(setLanguage), 500, 500);

            string s = Encoding.ASCII.GetString(response);

            if (!s.Contains("zpl"))

            {

                Log.Debug(tag, "Not a ZPL printer.");

                return false;

            }

            return true;

        }

 

        private bool CheckPrinterStatus(IConnection connection)

        {

            IZebraPrinter printer = ZebraPrinterFactory.Current.GetInstance(PrinterLanguage.ZPL, connection);

            IPrinterStatus status = printer.CurrentStatus;

            if (! status.IsReadyToPrint)

            {

                Log.Debug(tag, "Printer in Error: " + status.ToString());

            }

            return true;

        }

 

        protected override void OnPause()

        {

            base.OnPause();

 

            Log.Debug(tag, "Closing connection on inactive app");

            if ((connection != null) && (connection.IsConnected))

            {

                connection.Close();

            }

        }

    }

}

Main.axml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:orientation="vertical"

    android:layout_width="match_parent"

    android:layout_height="match_parent">

    <EditText

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:id="@+id/address"

        android:hint="@string/Address" />

    <Button

        android:id="@+id/MyButton"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:text="@string/Hello" />

</LinearLayout>

 

Robin West

Solution Architect

Zebra Technologies

We’ve all been there. You start your day with a nice cup of coffee and start clicking through the emails. Suddenly your boss shows up and says “Our biggest customer asked for feature X. Make it happen.”  Normally a quick Google search will get you started, but this time he also drops a stumper on you.He puts a box on your desk. Maybe it’s old looking or just newly shipped. You tentatively peek inside to see a strange device. He tells you it’s a printer.  It doesn’t look like any printer you’ve seen. You’ve been told you need to make your app print an inventory label or a receipt with it. Now what? Where do you even start?

 

Zebra has just published a new guide just for those of you who have never worked with a Zebra printer before. It guides you through step by step initial set up of your printer and making sure it can communicate the way you want it, through creating your first printing app. We hope you find it useful.

 

P.S. The first step is not- plug the printer into the computer.

 

Robin West

Solution Architect

Zebra Technologies ISV

Developer.zebra.com

Good Evening developers!

I'm very excited to announce we now support Xamarin in our Link-OS Multiplatform SDK.  This is a subject near and dear to me.  I, like many developers in this business, am primarily a C# coder.  Many developers who use our products have worked on server and older Windows Mobile/CE OS's using .NET.  Not to mention, I like C# and Visual Studio. Updating skills for these newer mobile OS's is a difficult transition.  Xamarin, just acquired by Microsoft, is a developer toolset that allows me and other developers to use our skills and create modern apps for mobile OS's or move older apps to them.

 

 

Xamarin is integrated into Visual Studio (2012 and 2015) and is now FREE for small teams.  There is also a Xamarin Studio for MAC users and iOS development.  You can write apps in C# and compile them for Android or iOS. 

 

 

I was also proud to be the lead developer on this project at Zebra.   Now you know who to blame if your favorite feature is not there yet.    I focused this SDK on maximum platform code reuse, ease of development, and giving you good samples to work from.  We are releasing the SDK as a Xamarin Plugin to enable the greatest amount of cross-platform support with the least amount of platform specific coding. 95% of the APIs are completely reusable across Android, iOS, and Forms apps even though the underlying libraries are very hardware targeted.  We also added a Developer Demo to show best practices in a real printing app. 

 

 

The supported API's are light right now, but we plan to update and add more over time and as the other SDK's get updated.  I'd love to hear your feedback on what we can do to improve this kit.  You have a lot of influence over these SDK's as Zebra is committed to enabling our developer community.

 

 

You can find the Plugin in the LINK-OS MULTIPLATFORM SDK, the Xamarin Component Store, and Nuget

Full API Documentation is on Zebra Techdocs

 

Robin West

Solution Architect

Robin West

RhoMobile Printing Sample

Posted by Robin West Expert Feb 24, 2016

Along with the sample code we recently posted to show an easy way to print from a webpage using Enterprise Browser, we have also published a sample of the same app using the RhoMobile suite as a thin client app for printing from websites. 

 

RhoMobile applications are OS-agnostic, able to support enterprise- and consumer-class operating systems including Windows® Embedded Handheld, Windows® CE, Apple® iOS, and Android®. You have complete control over how applications behave on different devices. With RhoMobile Suite, you are finally free from OS design constraints, able to create business applications that are every bit as elegant looking and intuitive as their consumer counterparts.

 

Try this new sample code walk-through of using the printing capabilities and provide your feedback.

Zebra Technologies - Printing Labels – RhoMobile - JavaScript

Filter Blog

By date:
By tag: