This manual is specific to PCL Barcodes & More 1.5. For manuals of other products, visit Documentation List.

3.3. LPR

When the printer is connected to a TCP/IP network directly, the best method is to send commands through lpr command. A TCP/IP device may be identified with a full qualified DNS name, or an IP address. In our test lab, we assigned our network printer a fixed IP address 192.168.1.22, and we use this address in the examples below. In lpr manual page, it is also referred as Printer Name.

Another name you will need is Queue Name. The queue names are names assigned to the “processors” in the print server. Most print servers and network printers have hardcoded queue names. Some allow you to define your own queue. On HP JetDirect printer servers, the raw PCL queues are named as raw, raw1, raw2 and raw3. In test files we use raw as the queue name.

Note that lpr command only accepts 1 file at a time. However, the step1 and step2 commands must be sent in one stream, otherwise the printer will discard them altogether. As a result, you will need to merge these three files into one first. On Windows, you can use copy command:

copy /b C80D.txt +mrvcode39_4pitch.sfp +c5F.txt total.bin

On Linux/Unix platforms, use cat command:

cat c80D.txt mrvcode39_4pitch.sfp c5F.txt > total.bin

Now we can send these files (Windows):

lpr -S 192.168.1.22 -P raw -ol total.bin 	
lpr -S 192.168.1.22 -P raw -ol data.txt

You need to replace the ip address, the queue name and the file name with the appropriate ones in your environment.

On Linux/UNIX platforms, things are more complicated. The configuration varies from platform to platform. Generally you need to set up the printer first. On RedHat Linux, this can be done using printtool. You assign a printer name (queue name) in the configuration, and you use this name in lpr command. Assume that the name is HPPrinter, the lpr command on RH Linux becomes:

lpr -P HPPrinter -o raw total.bin 	
lpr -P HPPrinter -o raw data.txt