Passthrough Printing Connection


Contents

About This Document
Overview of Steps
Procedure
Alternative for Passthrough Escape Codes
A Couple of Cautions

About This Document

Passthrough Printing Through a Dynamic Terminal Type Connection

There are cases where a user will be connecting to the RISC system via a dynamic device. This could be connecting to the RISC via a modem pool on the RISC so that the user may have a different tty each time he dials the system. It may also be a user that is using AADU (AIX Access for Dos Users), and is connecting via a different pts each time. These users at times wish to print something from the RISC to a printer connected to their terminal/PC. If the terminal/PC supports an escape sequence to enable/disable Passthrough Printing, then we can create a solution that will do this.

The following solution is directed toward the AADU connection, but could easily be modified to the above mentioned modem pool by replacing the references to "pts" with "tty".

This document applies to AIX Versions 3.2 and 4.1.


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 (hence 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 the user's port each time the user is connected to the host via AADU.
This would allow the user to perform passthru printing through the port he is currently connected to.

Procedure

A. Create a queue that prints to a file.

AIX 3.2

  1. As root: touch /dev/dynamic_device1
  2. Enter smit printer fastpath at the command line.
  3. Select "Manage Local Printer Subsystem".
  4. Select "Virtual Printers".
  5. Select "Add a Virtual Printer".
  6. Chose 1 for "Printer or Plotter Attached to Host".
  7. Enter dynamic_device1 for device name.
  8. On the proceeding screen, chose the "ASCII printer" option.
  9. Next go through the ASCII printer options screen:
  10. When you are brought back to the Virtual Printer Screen, select "Change/Show Characteristics of a Virtual Printer".
  11. Choose the number for the virtual printer you have just added.

    Then on the proceeding screen, enter the following:

     
    ci=\020\022 
    cr=\020\024 
    
  12. The ci attribute initializes the printer for passthru. mode. The cr attribute restores it at job end. If you wish to view the entire list of attributes, enter * on this screen.
  13. See step B on the following page.

AIX 4.1

  1. As root: touch /dev/dynamic_device1
  2. smit rq
  3. Add a 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 this completes press F3 twice to get back 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 following screen will prompt you for an attribute. enter:
     
    ci=\020\022 
    cr=\020\024 
    
    The ci attribute initializes the printer for passthru. mode. The cr attribute restores it at job end. If you wish to view the entire list of attributes, enter * on this screen.

    Note: The above sets the ci and cr attribute to the codes for an ibm3151 terminal. If you are using another terminal you would need to modify the \020\022 and \020\024 to the codes for your terminal. \033 is used to represent the escape character.

  14. Go to step B below.

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 (from our example for the user "bill")
 
ln -fs 'tty' /dev/dynamic_device1 

NOTE: Use back-tics, NOT quotes, in the ln command line above. (A back-tic is found in the top number-key row on a regular 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. Then it establishes a link to the new port for the current session. Thus 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 DOS machine, all you need to do is create a separate queue for that user and follow the steps outlined above. For example, to print to the aadu queue, we entered the following command:

 
enq -Paadu filename 

Please note that this method prints in passthrough mode only, meaning that the local DOS machine will be temporary inactive while it prints.


Alternative For Passthrough Escape Codes

Sometimes a user will be dialing in or connecting from different terminal types. The above method only sets a single set of codes and will only work 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. This can be done by modifying the last few steps of the above method (after step 9 in AIX 3.2, after step 8 in AIX 4.1).

AIX 3.2

 
cd /var/spool/lpd/pio/custom 

AIX 4.1

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

In this directory should be a filename that follows the form:

 
[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: There is an accent mark or back-quote before the Wo and the Wf in the command lines above that may or may not show up 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 person to modify the /dev/dynamic_device1 link is the one that will control where the print jobs will go.
  2. If your terminal sessions ends during the printing, the queue will go DOWN. That job will attempt to print whenever the queue is enabled, and will attempt to print to the device pointed to at that time by /dev/dynamic_device1.

Passthrough Printing Connection: tap.dynamic.32-41.zap ITEM: FAX
Dated: 99/01/13~00:00 Category: zap
This HTML file was generated 99/06/24~12:42:07
Comments or suggestions?
Contact us