Passthrough Printing Connection


Contents

About this document
    Related documentation
Overview of steps
Procedure
Alternative for passthrough escape codes
A couple of cautions

About this document

This document details the steps needed to enable passthrough printing via a dynamic terminal type connection.

At times, the user may connect to the RISC system through a couple of dynamic devices: he may connect to the RISC via a modem pool on the RISC so that he will have a different tty each time he dials the system, or he may connect through a telnet session and wants to print something from the RISC to a printer connected to his terminal or PC. If the terminal or PC supports an escape sequence to enable/disable passthrough printing, he can create a solution to enable it to do so.

NOTE: The solution provided in this document applies to the telnet connection, however, you could easily modify the modem pool connection mentioned above by simply replacing the references to "pts" with "tty".

The information in this document applies to AIX Versions 4.x.

Related documentation

The product documentation library is also available:
http://www.rs6000.ibm.com/resource/aix_resource/Pubs/index.html


Overview of steps

  1. Create a virtual printer with pts as the device.
  2. Put in the escape code to initialize the printer into passthru. mode and the escape code to restore the printer at job end (so you do not need the script).
  3. Create a symbolic-link file in the user's $HOME directory by changing the file name in the stanza in /etc/qconfig for the pts-printer you have just created.
  4. Link the file to your port each time you are connected to the host via AADU (AIX Access for DOS Users). This would allow you to perform passthrough printing through the port you are currently connected to.

These steps would allow you to perform passthrough printing through the port you are currently connected to.


Procedure

A. Create a queue that prints to a file.
  1. As root user, enter: touch /dev/dynamic_device1
  2. smit queue
  3. Select Add a Print Queue
  4. Select file        File (in /dev directory)
  5. Select Other
  6. Select Generic
  7. Fill in dynamic_device1 for the filename.
  8. Fill in the name of the queue in the ASCII field.
  9. Once finished, press F3 twice to return to the Print Spooling menu.
  10. Select Programming Tools
  11. Select Change / Show Printer Attribute Database (Virtual Printers).
  12. Select your print queue.
  13. The next screen will prompt you for an attribute. Enter:
    ci=\020\022
    cr=\020\024
    
    The ci attribute initializes the printer for passthru. mode, and the cr attribute restores it at job end. To view the entire list of attributes, enter * on this screen.

    NOTE: The preceding entry sets the ci and cr attribute to the codes for an IBM 3151 terminal. If you are using another terminal, modify the \020\022 and \020\024 to the codes for your terminal. \033 represents the escape character.

B. Perform a link to the port each time the user is connected.

  1. Add the following line to .profile in the user's $HOME directory.
	ln -fs 'tty' /dev/dynamic_device1

NOTE: Use back-tics, NOT quotes, in the ln command line above. (A back-tic is in the top number-key row on a standard keyboard, on the key just left of the number 1 key, and just above the TAB key.)

The -f flag will automatically remove any old links to the old port from previous sessions, and then establish a link to the new port for the current session. This enables you to print through the current port as it changes each time you are logged in. Note that root will have created the /dev/dynamic_device1 with permissions that allow the users to remove and recreate this file.

For each user that wants to access the printer on the telnet machine, all you need to do is create a separate queue for that user and follow the preceding steps. For example, to print to the aadu queue, enter the following command:

	enq -Paadu filename

NOTE: This method prints in passthrough mode only, which means that the local telnet machine will be temporarily inactive while it prints.


Alternative for passthrough escape codes

Sometimes the user will dial in or connect from different terminal types. The preceding method sets only a single set of codes and works only with a single terminal type.

As an alternative, you may define another set of attributes for the queue and set the ci and cr attribute to obtain the terminal passthrough codes from terminfo. To do this, modify the last five steps in the preceding method (after step 8).

cd /var/spool/lpd/pio/@local/custom

This directory should have a filename similar to the following:

[queuename]:[queue_device]
Run each echo statement as one command line:
echo :998:Wo::tput mc5 >>
[queuename]:[queue_device]
echo :999:Wf::tput mc4 >>
[queuename]:[queue_device]
chvirprt -q [queuename] -d
[queue_device] ci=%\ Wo
chvirprt -q [queuename] -d
[queue_device] cr=%\ Wf

NOTE: The accent mark or back-quote before the Wo and Wf in the command lines above may or may not appear in your printed document.

This will cause the queue to obtain the passthrough strings from the terminfo database at the time of printing.


A couple of cautions

  1. The last user to modify the /dev/dynamic_device1 link will control where the print jobs go.

  2. If your terminal sessions end during the printing, the queue will go DOWN. That job will attempt to print whenever the queue is enabled, and it will attempt to print to the device pointed to at that time by /dev/dynamic_device1.



[ Doc Ref: 90605223514654     Publish Date: Spt. 29, 2000     4FAX Ref: 5932 ]