Sending Printer Commands to Printers
Contents
About this document
Cautions
Method One - Put commands in file and cat
Method Two - Use virtual printer ci attribute
About this document
The purpose of this document is to show how to send individual
print commands to printers. First, you will need to determine the
print command that you want to send by looking at the printer programming
or technical reference manual.
This document describes how you can
enter the commands in AIX either using a file or a virtual printer, and
then send these commands to the printer. This might be useful
for sending a command that is not normally sent with the virtual printer,
or even used for downloading fonts or printer macros.
This document applies to AIX Versions 3.2.5 and 4.
Cautions
Some commands sent to printers this way will be overwritten by other commands
if you later print through a virtual printer. If this is a problem,
add the commands to the end of the ci attribute in the virtual printer.
Furthermore, some commands are reset
each time the printer reset command is sent to the printer. The printer
reset command is usually sent to the printer before and after a print job
by the ci and cr attributes. You may have to remove the printer
reset command if it causes problems.
Method One - Put commands in file and cat
This method can be used to download macros and the like.
-
Create a file with an editor such as vi.
-
Enter commands using the key sequence Ctrl-V ESC to enter the escape character.
-
x01 can be entered as Ctrl-V Ctrl-A; x02 can be entered as Ctrl-B and so on.
-
The ESCAPE character will look like ^[ or ctrl-<left square bracket>.
-
Save the file.
-
cat to the printer.
-
If you are printing to a local printer (/dev file),
-
put in passthrough with splp -p+ lp2.
-
cat the file to print, enter cat <filename> > /dev/lp2
-
If you are printing to a remote queue with no formatting, simply print
the file to the queue.
-
If you are printing to a JetDirect attached printer send with the following command:
-
piohpnpf -x<hostname> <filename>
Method Two - Use virtual printer ci attribute
-
Add a virtual printer as type generic.
-
Use the command lsvirprt to modify the virtual printer.
-
Set ci=<command string>. Use \33 for escape,
at AIX Version 4, \x1b also can be used.
-
Example: ci=\33&l7.5C sets the Vertical Motion Index for a PCL
printer.
-
If you have a percent sign in the sequence it must be entered twice.
[ Doc Ref: 91746656211350 Publish Date: Mar. 06, 2001 4FAX Ref: 6450 ]