Wednesday, October 31, 2018

Printing Barcode from Command Line to USB Printer Remotely

Hardware Required

This is achieved using Ethernet to USB Print Server adapter. This should not to be confused with USB to Ethernet adapter where the USB port connects to the PC and Ethernet port connects to a networking router.

Hardware Setup

  • Connet the USB barcode printer to a print server adapter.
  • Connect printer server network port to network router
  • Power up and assign a static IP address to the printer server

Print Server Configuration

Access the print server via a browser http://<ip address>


This screen may look different depending on the print server make.

Take note of the port name. This will be used as print queue name when executing lpr command. Using other name as the queue name might return the following error:

Error: print server did not accept request.  Job aborted.

Barcode Programming Language File

Prepare your barcode file, e.g. test.zpl

LPR

LPR stands for Line Printer Remote. On a windows system, this is not enabled by default. Go to Windows Features to enable LPR.

Send the ZPL file using the following command:

                                    
lpr -S 129.10.10.101 -P U1 test.zpl 
                                    
When sending print request to USB print server, the print queue name should be set to the port name that the printer is connected to.

2 comments: