Print to a Shared Card Printer with SDK

Article ID: 27246493



This solution is useful for printing to a shared card printer using Zebra's Software Development Kit (SDK)

Applies To

Any of the card SDKs


The card SDKs support shared printers as long as they are on the same network as the computer implementing the SDK. Before the SDK can be used to access the shared printer, the shared printer must be properly installed with the appropriate driver on the host machine.


During installation, or after the fact (under Printer Properties), the printer must be set to shared, be listed in the directory, and given a shared name.  Once this is completed, any computer on the network can access this printer via the SDK by using '\\Computer-Name\Shared-Printer-Name' as the printer name.  The computer name refers to the machine to which the printer is connected, and can be found by right clicking on My Computer > Properties > Computer Name > Full Computer Name.  

The printer name should look like this when implementing the SDK:

printerName= "\\ComputerName\UsbShareName"
ZBRGetHandle(out theHandle, printerName, out printerType, out errValue)

Some common pitfalls include:

  • Using the wrong computer name.  Be sure that you are using the name of the computer to which the printer is connected when calling the printer name.
  • The printer is not set to be shared.
  • Improper formatting - In languages such as C#, be careful to properly format your string.  In the above example, an arroba will guarantee that the printer name string is correct: @"\\ComputerName\UsbShare


+ Product Codes