C-Kermit 7.0 Case Study #09

[ Previous ] [ Next ] [ Index ] [ C-Kermit Home ] [ Kermit Home ]

Article: 10943 of comp.protocols.kermit.misc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Case Study #9: Printing
Date: 16 Jan 2000 23:40:08 GMT
Organization: Columbia University

C-Kermit 7.0 offers many ways to print, some of which are new. This discussion focuses on the Unix version of C-Kermit but to some extent also applies to Kermit 95 and MS-DOS Kermit.

Each kind of printing uses the SET PRINTER value as the destination for material to be printed. You can see the current SET PRINTER value with SHOW PRINTER. The default PRINTER value is "(default)", which means to use the default system printer. The Unix version of C-Kermit lets you select different SET PRINTER values, which can be:

  1. A filename, to redirect all printer output to the specified file. Each print operation appends to the given file (or creates it if it doesn't exist).

  2. A pipeline; that is, a pipe symbol followed by one or more commands, which are to receive the material to be printed as standard input; for example "set printer {| lpr -PLaserJet5L}". Of course the command need not be "lpr"; it can be anything at all.

Printing methods include:

  1. The PRINT command, which lets you print a local file. You can include printer options after the filename; for example in Unix (when using "lpr"): "print oofa.txt -#3" to print 3 copies of the oofa.txt file.

  2. SET DESTINATION PRINTER. This tells C-Kermit that any files received using Kermit protocol are to be sent to the SET PRINTER device, rather than stored on disk. (Other destinations include DISK, SCREEN, and NOWHERE.)

  3. The SEND /PRINT command tells C-Kermit to send a file to the Kermit program on the other computer and have it printed there (RPRINT and REMOTE PRINT are synonyms for SEND /PRINT).

  4. The -G command-line option, new to C-Kermit 7.0, is like -g (GET) but sends the incoming file to standard output so it can be piped into a command such as "lpr".

  5. Transparent printing, new to C-Kermit 7.0, operates when C-Kermit is in CONNECT mode.

Transparent printing is initiated by the host when it sends the escape sequence <ESC>[5i to the terminal (when C-Kermit is in CONNECT mode, C-Kermit is the "terminal"). All subsequent material goes to the printer (rather than the screen) until the escape sequence <ESC>[4i arrives, which means to stop printing.

C-Kermit 7.0 does transparent printing only if you tell it to SET TERMINAL PRINT ON. By default, TERMINAL PRINT is OFF for compatibility with previous releases and also because you might be accessing Unix from a real terminal or a terminal emulator that you want to handle the transparent printing. The SHOW TERMINAL command tells you whether PRINT is ON or OFF.

Unlike the Kermit-protocol based methods, transparent printing is NOT error-checked; this can make a difference on serial connections that are noisy or not well flow-controlled. Also, transparent-print material is not converted in any way. When using the Kermit protocol methods, on the other hand, you get error-free data transfers in your choice of text or binary mode and, with text transfers, your choice of character-set translations. For details about transparent printing, see Section 3.3 of ckermit2.txt.

Now let's try to make some sense of this jumble. When you are using Kermit, you are usually using two computers at once: one (let's call it A) where you have used to Kermit to make a connection to the second one (call it B). Either Computer A or Computer B (or both) can have a printer that you want to use. Considering these two computers:

  1. You can print a Computer A file on Computer A's printer.
  2. You can print a Computer A file on Computer B's printer.
  3. You can print a Computer B file on Computer A's printer.
  4. You can print a Computer B file on Computer B's printer.

Here is a summary of some (not necessarily all) ways to do each with Kermit:

  1. To print a local file from the Kermit prompt on Computer A:

  2. To send a (local) file from Computer A to be printed on Computer B:

  3. To print a Computer B (remote) file on Computer A's (local) printer:

  4. To use Computer A to cause a Computer B file to be printed on Computer B:

For symmetry Kermit should also have a GET /PRINT print command; this will be added in a future release. For now use SET DESTINATION PRINTER, GET, and then SET DESTINATION DISK to restore the default destination in case you will be transferring more files.

- Frank

[ Top ] [ Previous ] [ Next ] [ Index ] [ C-Kermit Home ] [ Kermit Home ]

C-Kermit 7.0 / Columbia University / kermit@columbia.edu / 16 Jan 2000