Printing from Linux
Introduction
The DM API provides labels and documentation in PDF format. Printing this under Windows is a matter of using Adobe Acrobat Reader. However, under UNIX (in this case Linux), there are a few problems to overcome. Notably, the lack of support from label printer manufacturers.
In a warehouse environment, you will usually find either a dumb-terminal or a Windows PC at the pack-bench. A label printer and, possibly, an A4 printer will be wired to that PC and located on the bench. There are other variations, but I will concentrate on the Windows-based pack-benches model.
Before we go any further, we need to establish some important facts. MetaPack Delivery Manager labels are always 6"x4". When we set up our printers, we will set that as the default page size.
Next, we need to understand that there are security issues involved. We will need to authenticate to the Windows machine, which will, in turn, allow us access to print to the printer. This might involve using a single print server, but it is just as possible to talk directly to the PC and the shared printer.
Finally, I will demonstrate setting this all up on a Debian (Ubuntu) distribution of Linux. Other flavours will have files in different places, but the essence is the same.
Phase One: Installing the Software
The print spooler of choice is CUPS. We will also need Samba Client to communicate with the printers attached to Windows machines.
sudo apt-get install cupsys smbclientThat should set everything out for you. As we're going to be sticking in our own drivers, there's no point downloading anything else. Unless, of course, you're planning on producing the A4 international documentation, in which case you might want to consider downloading the HP (or whatever) printer driver using apt too.
Phase Two: Gathering Information
At this stage, there is some information to be gathered.
- Windows user account that has access to print queue on Windows box
- The IP/name of a pack-bench to experiment with
You will also need to gather the Linux printer drivers for your label printers. This is easier said than done, particularly when popular manufacturers (such as Zebra) refuse to support Linux. Luckily, there are those in the community who have ploughed on and written their own drivers.
Phase Three: Setting up the printer
Lets assume that we have gathered the following information:
Windows user account: DOMAINNAME\PrinterUser with a password of password IP of pack-bench: 10.11.12.13
We can now identify the shared printers on that machine (if we don't know them already) using smbclient.
smbclient -L 10.11.12.13 -U "DOMAINNAME\PrinterUser" Domain=[DOMAINNAME] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager] Sharename Type Comment --------- ---- ------- ZebraLP2844 Printer Thermal Printer - 4" x 6" labels IPC$ IPC Remote IPC print$ Disk Printer Drivers ADMIN$ Disk Remote Admin C$ Disk Default share
The Windows XP pack-bench shows that there is a label printer shared as ZebraLP2844. And this has also served to verify the login credentials we will be using.
We are now ready to add the printer to the Linux box. Upload the driver PPD to a directory of your choice (I've attached an example one for the Zebra LP2844 at the bottom of this page). Then go to that directory and issue the command to add the printer:
lpadmin -p printer001 -v smb://DOMAINNAME\PrinterUser:password@10.11.12.13/ZebraLP2844 -P lp2844z.ppd
To have the changes reflected, you need to restart CUPS:
/etc/init.d/cupsys restart
To make sure everything is set up correctly, you can print a test label:
lp -d printer001 testfile.pdf
| Attachment | Size |
|---|---|
| lp2844z.zip | 1.62 KB |

