Have a Question?
Print

00067: How to create a printer alias, with examples for an HP laser jet

Title:

How to create a printer alias, with examples for an HP laser jet

Description:

BBx uses escape sequences (rather than drivers) to communicate with printers and to instruct them to print in specific ways. A printer alias line uses different modes, such as SP= and CP=, that are comprised of escape sequences that determine the setup of the printer and how it will print. Please note, the following codes are an example and the exact escape sequence for a specific printer may be different. Here’s an example of CP mode for an HP laser jet III: 

        CP=1B451B266C363070316F386432411B266B3253 

The string of numbers are the escape sequences (also known as PCL codes) that the printer uses. Here’s a breakdown of CP=1B45 1B266C 363070 316F 3864 3241 1B266B3253 

1B45 <- Reset 
1B266C363070 <- Page Length of 60 
316F <- Landscape 
3864 <- sets 8 lpi 
3241 <- Page size of Letter 
1B266B3253 <- sets pitch to compressed (16.5 – 16.7) 

These sequences are taken directly from the HP laser jet manual. However, we list the escape sequences in hex for an alias line, while some manuals list them in ASCII. For example, a printer manual may say that to cause the printer to set the page length to 60 (1B266C363070 in the above example), you should supply an ESCAPE&l60p. An ASCII chart, such as the one in the PRO/5 Quick Reference Guide, can be used to translate their escape sequence to hex so that a CP= mode can be created. For the given example, an ESCAPE is a 1B. An & is a 26. A l is a 6C, and so on. 

So, to make your printer print in compressed mode, find out what escape sequences your printer uses (from its manual), and create a custom alias line for it. Additionally, you can often get the escape codes for a printer by printing out the test print pages provided by the manufacturer. 

Note that the above information only applies if you are printing directly to the device. If printing under Windows to the SYSPRINT device, simply specifying the appropriate number of lines and columns for compressed print is enough. For example, these would be two of the modes on your alias line: 

CPCOLS=132, CPLINES=66 

Lastly, here are some sample alias lines: 

alias P0 /dev/lpt1 “HP LASER JET III” CR,SP=1B451B266C3664306F36367032411B266138306D304C1B266B3053, 
CP=1B451B266C363070316F386432411B266B3253,CPCOLS=177, 
SPCOLS=80 

Break down of PCL codes for above alias line: 

SP=1B45 1B266C3664 306F 363670 3241 1B266138306D 304C 1B266B3053 

1B45 <- Reset 
1B266C3664 <- sets 6 lpi 
306F <- Portrait 
363670 <- Page Length of 66 
3241 <- Page size of Letter 
1B266138306D <- Right margin of 80 
304C <- Left margin of 0 
1B266B3053 <- sets pitch to 10.0 


CP=1B45 1B266C 363070 316F 3864 3241 1B266B3253 

1B45 <- Reset 
1B266C363070 <- Page Length of 60 
316F <- Landscape 
3864 <- sets 8 lpi 
3241 <- Page size of Letter 
1B266B3253 <- sets pitch to compressed (16.5 – 16.7) 



alias P6 “>lp -dofficelj -s 2>/dev/null” “Office HP Laser Jet II” CR,CP=1B266C306F372E3237633636461B283130551B2873307031362E363668382E3576307330623054,
CPCOLS=132,PTON=1B266C3148,PTOFF=1B45,SP=1B266C306F372E3237633636461B283130551B28733070313068313276307330623354,SPCOLS=80

This sets standard print orientation to portrait, paper tray auto feed, vertical motion to 7.27, text length of 66, using a PC-8 font, with fixed spacing, 10 pitch, 12 point, upright style, medium stroke weight, courier typeface. Compressed is the same except for a 16.66 pitch, a 8.5 point size, and line printer typeface. 



Last Modified: 04/04/2000 Product: PRO/5 Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

Table of Contents
Scroll to Top