Sending Printer Commands to Printers


About this document
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.


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.
  1. Create a file with an editor such as vi.

  2. Enter commands using the key sequence Ctrl-V ESC to enter the escape character.

  3. x01 can be entered as Ctrl-V Ctrl-A; x02 can be entered as Ctrl-B and so on.

  4. The ESCAPE character will look like ^[ or ctrl-<left square bracket>.

  5. Save the file.

  6. cat to the printer.

  7. If you are printing to a local printer (/dev file),

  8. If you are printing to a remote queue with no formatting, simply print the file to the queue.

  9. If you are printing to a JetDirect attached printer send with the following command:

Method Two - Use virtual printer ci attribute

  1. Add a virtual printer as type generic.

  2. Use the command lsvirprt to modify the virtual printer.

  3. Set ci=<command string>. Use \33 for escape, at AIX Version 4, \x1b also can be used.

  4. Example: ci=\33&l7.5C sets the Vertical Motion Index for a PCL printer.

  5. 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 ]