08/28/96, 4FAX# 5932 Passthrough Printing Connection SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. 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 con- nection, but could easily be modified to the above mentioned modem pool by replacing the references to "pts" with "tty". 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 direc- tory 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. Passthrough Printing Connection 1 08/28/96, 4FAX# 5932 THE STEPS ARE AS FOLLOWS: 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: Header? (n) Trailer? (n) Queue name? (enter the name for the queue here, we called ours aadu) Default queue? (n) 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. Passthrough Printing Connection 2 08/28/96, 4FAX# 5932 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 con- nected. 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 backward quotes in the ln command line above. 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 Passthrough Printing Connection 3 08/28/96, 4FAX# 5932 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 dif- ferent 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 This will cause the queue to obtain the passthrough strings from the terminfo database at the time of printing. Passthrough Printing Connection 4 08/28/96, 4FAX# 5932 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 5 08/28/96, 4FAX# 5932 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: Name: Fax Number: ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ END OF DOCUMENT (tap.dynamic.zap,4FAX# 5932) Passthrough Printing Connection 6