KB#10002 explains how to download PCL fonts using Copy command. To use this approach, the printer must be physically connected to a computer via a parallel or USB port and shared across a Windows network. Another widely deployed solution is to connect the printer to the LAN directly using a built-in network adapter or a print server adapter. This configuration allows computers running operating systems such as UNIX and Macintosh to print using LPD protocol.
Note
To use this approach, the printer must be connected to a TCP/IP network directly and has the PCL interpreter built in. Some printers rely on the host driver to interpret PCL commands and do not accept direct PCL stream. Check with your printer configuration to make sure that the PCL interpreter is built in the printer itself.
Before we go details about LPR command, it is necessary to explain two terms used in the LPR.
- Printer Name
The printer name refers to the host name or the IP address of the printer device, depending on the network configuration. A TCP/IP device may be identified with a full qualified DNS name, or an IP address. In our test lab, we assign our network printer a fixed IP address
192.168.1.22
, and we use this address in the examples below.- Queue Name
The queue names are names assigned to the "processors" in the print server. Most print servers and network printers have the queue names hardcoded. On HP JetDirect printer servers, the raw PCL queues are named as
raw
,raw1
,raw2
andraw3
. In the below example we useraw
as the queue name. Replace this name with the one from your printer.
Tip
If you installed the printer driver on Windows, you can locate the LPR
settings in the Port Settings dialog. To do this, first
right click on the printer in Printer and Faxes list and
select Properties. Select Ports tab
and click on button. You can find Printer Name
and Queue Name
in the dialog followed.
As indicated in KB#10002, you perform three steps to send the font to a printer. The first command, Font ID, assigns a unique number to the font followed. After that you send the font binary file to the printer. The last step makes the font permanently reside in the RAM by sending the Make Font Permanent command.
Note
The font resides in the printer RAM; therefore it can not survive a power outage or power reset. To make sure that you always have the font available, repeat the font downloading steps at the beginning of each print job.
In our example, we store the data in three separate files: font-id.txt
, code39ma.sfp
, set-font.txt
. We can use copy to send them in one
stream. However, the LPR command does not support concatenating files.
We need to combine these three files into one first and this
can be done using the COPY command:
copy /b font-id.txt +code39ma.pcl +set-font.txt total.bin
After we combine the three files into one, we can then use lpr to send the font:
lpr -S 192.168.1.22 -P raw -o l total.bin
The option -o l
is needed to send the
file in binary format to the printer.[1]
After we complete sending the font, we can send the content.txt
to the printer to print a test page:
lpr -S 192.168.1.22 -P raw -o l contents.txt
Note: the lpr option “l” is the l as in “lucy”, not digit 1.