makebarcode.com
 

 


Barcode InfoPCL FontsHome

 

Downloading PCL fonts to network printers using the lpr command
Home > Barcode Basics >
Application Notes > AppNote019

Printing barcodes with downloadable PCL fonts requires that the font file be sent to the printer, followed by the document file which contains escape sequences and data to select the correct font and print the barcodes. The lpr command can be an effective way to send fonts and data to a network printer if your system has that capability. 32-bit versions of Windows (NT, 2000 and XP, for example) support lpr printing, although the feature may not be installed by default; lpr is a standard part of Unix and Linux systems.

The general form of the lpr command is:

lpr -S<server> -P<printer> [-C<class>] [-J<job name>] [-O<option>] <filename>

As an example, let us assume that the destination printer is available at IP address 192.168.100.40; a file named C3925501.dsf contains the downloadable PCL barcode font; and a file named MyReport.txt contains the data we want to print. First we must download the font to the printer, but we must do it in binary mode; the font file contains bitmaps, and if the system or the printer think it is text and try to print it we will get strange results. To specify binary mode, use -O (option) followed by a lower case "L":

lpr -S192.168.100.40 -P192.168.100.40 -Ol C3925501.dsf

Next, print the data file omitting the -O command line option (without the option the default print mode is text):

lpr -S192.168.100.40 -P192.168.100.40 MyReport.txt

Both of these lines can be combined in a single batch or script file to automate the process.

   

home
Contact:  info@makebarcode.com
(c) Copyright Measurement Equipment Corporation
All Rights Reserved