VMS Printing Forms and Setup Modules


Quick Reference Jumptable


Overview

Carleton's VAXen and Alphae communicate with printers via ports on terminal servers using the same protocols you use to log in: VMS views printers as write-only terminals. However, there are hundreds of different printers out there, and users want their documents to be printed in innumerable ways on every kind of paper imaginable. VMS computers use a system of print forms and setup modules to print different kinds of documents on different printers.

The heart of VMS printing is the print queue. Users place their print jobs on a queue, which feeds them to a printer one at a time. Each terminal queue sends jobs to one printer. The queues use a shared set of print forms which contain information on how to print the document, such as margins, width, space between page breaks, and what kind of paper is required (so, in theory, VMS can tell the operator to load custom paper when a user asks for it).

Usually, the default mounted form will be something nice, like 1PI (letter-size paper, long side up, 80 columns across, 66 lines per page). You can print using a different form, if necessary: to print the document FOO.TXT on the queue CRPRT using the form 1PX (Landscape 66X158), the user types

$ PRINT/QUEUE=CRPRT/FORM=1PX

To see the characteristics of the form 1PX, type

$ SHOW QUEUE/FORM/FULL 1PX

The VAX responds with

Form name Number Description --------- ------ ----------- 1PX (stock=CUT_SHEET) 206 Landscape 66x158 /LENGTH=66 /SETUP=(LJ1PX) /STOCK=CUT_SHEET /WIDTH=158

Note that these forms only tell VMS how to send text to the printer (put line feeds every 158 chars and form feeds every 66 lines), and don't actually send the control codes to the printer. To do this, VMS has text library files containing "setup modules" which are documents containing printer codes in the printer's native language (PCL-5 for Hewlett-Packard printers, PostScript for Laserwriters, etc.) which tell the printer how to behave for each print job. The definition of each form contains information on what setup module to use: in the previous example, this is the statement /SETUP=(LJ1PX).

These setup modules are kept in text libraries in the SYS$LIBRARY directory. When initializing a print queue, the system manager tells the VAX which setup library it should use for that printer. You can see what library a queue is using by typing

$ SHOW QUEUE/FULL

For example,

$ show queue/full crprt Terminal queue CRPRT, idle, on ADMIN1::CRPRT_TERM, mounted form DEV1PX (stock=CUT_SHEET) /BASE_PRIORITY=4 /DEFAULT=(FLAG=ONE,FORM=DEV1HP (stock=CUT_SHEET)) /NOENABLE_GENERIC /LIBRARY=LJDEVCTL2 Lowercase /OWNER=[DEVLPMNT,*] /PROCESSOR=LATSYM /PROTECTION=(S:E,O:D,G:E,W:W) /SCHEDULE=(NOSIZE)

The /LIBRARY statement says that this queue is getting its setup modules from the library LJDEVCTL2.TLB (Note that you must omit the .TLB extender when assigning libraries to queues! Otherwise...)

Notice that the library that the modules come from is defined by the queue, but the setup module is determined only by the form used. This enables the same form to be used on different printers. Suppose you have two queues named Apple and Orange. Apple uses the text library APPLE.TLB, orange uses ORANGE.TLB. Suppose you want to produce strawberry tarts out of both printers, but the two printers speak totally different languages. You can create a 2 different modules called TART_MODULE and put one in each library: the one in ORANGE.TLB tells how to make a tart on the Orange printer, the one in APPLE.TLB is specific to Apple printers. Then define a form (TART) which uses the setup module TART_MODULE. Since the library where the module resides is specified by the queue, not the form, if you print using the TART form on both queues, each printer will get the setup module specific to it. Forms at Carleton are designed this way: the user never needs to worry about what sort of printer he/she is using: the form 1PI looks the same from every queue. Or at least, it's supposed to.


Applications

How to define a new form for a new type of document:

Wait! - while Jason's stuff may be all well and good, please check out the easier way to create and modify new print forms. Suppose the business office wants a form to print checks in mirror-image text just to confuse Carleton's creditors. Suppose they want to print on a queue called CHKPRT. The first thing to do is to create a text file which tells the printer (in its own language) what to do. A sample text file might tell the printer to do the following things:
  1. Reset the printer's defaults
  2. Print from the upper paper tray (where the checks are)
  3. Print in portrait mode
  4. Print using backwards letters
In our example, we'll name this file MIRROR.TXT Next, type $ SHOW QUEUE/FULL/ALL CHKPRT

The VAX responds:

Terminal queue CHKPRT, idle, on ADMIN1::CHKPRT_TERM, mounted form DEV2HP (stock=CUT_SHEET) /BASE_PRIORITY=4 /DEFAULT=(FLAG=ONE,FORM=DEV1HP (stock=CUT_SHEET)) /NOENABLE_GENERIC /LIBRARY=LJDEVCTL2 Lowercase /OWNER=[DEVLPMNT,*] /PROCESSOR=LATSYM /PROTECTION=(S:E,O:D,G:E,W:W) /SCHEDULE=(NOSIZE)

Make a note of what setup library the queue uses (LJDEVCTL2.TLB in this case). When the queue is idle, warn the users and then stop it by typing

$ STOP/QUEUE/RESET CHKPRT

The /RESET qualifier is important: the queue won't let you play with its setup library unless you use it. Similarly, use SHOW QUEUE/FULL to find out if any other queues use the same library and STOP/QUEUE/RESET them as well. Then insert the text file you created into the library by using the command

$ LIBRARY/INSERT SYS$LIBRARY:LJDEVCTL2.TLB MIRROR.TXT

The text file MIRROR.TXT becomes a module called MIRROR inside the LJDEVCTL2 text library.

Now restart all the queues you stopped (so the users don't get annoyed) using the command

START/QUEUE queue-name

Finally, we have to define a new form to associate with this setup module. Do this in the following manner:

$ DEFINE/FORM/SETUP=(MIRROR) MIRROR

This creates a new form called MIRROR. Each form must have a unique but arbitrary number (4321, here) associated with it. Once this is done, the command

$ PRINT/QUEUE=CHKPRT/FORM=MIRROR CREDITORS.CHK

should print the file CREDITORS.CHK on the check printer in mirror-image type.

How to modify an existing setup module

First, extract the old module out of the text library (you don't need to stop the queues for this) with a command like $ LIB/EXTRACT=MIRROR/OUTPUT=MIRROR.TXT SYS$LIBRARY:LJDEVCTL2.TLB

This creates a file called MIRROR.TXT, but leaves the old MIRROR module still in the library. Edit mirror.txt as necessary, then stop/reset the queues and issue a command like

$ LIB/REPLACE SYS$LIBRARY:LJDEVCTL2.TLB MIRROR.TXT

Then restart the queues.

How to make changes to a form definition

If you issue the DEFINE/FORM command with an existing (and matching) form name and number and new qualifiers to the DEFINE keyword (like define/form/margin=(left=20) mirror 4321), the existing form will be modified.

Changing a queue's default library

First, stop the queue. Then use the command $ START/QUEUE/LIBRARY=library-name

Helpful hints

Creating and modifying setup modules can be a long and arduous process with lots of trial and error. Continually starting and stopping the queues will tend to annoy the users you're trying to help. It's a good idea to create a second queue which points to the same printer which you can start and stop at will, and a second copy of the setup library which you can modify all you want. Then, when the setup works, replace the existing library with the new one. To make a new queue, first see what the old one looks like: $ SHOW QUEUE/FULL/ALL CHKPRT Terminal queue CHKPRT, idle, on ADMIN1::CHKPRT_TERM, mounted form DEV2HP (stock=CUT_SHEET) /BASE_PRIORITY=4 /DEFAULT=(FLAG=ONE,FORM=DEV1HP (stock=CUT_SHEET)) /NOENABLE_GENERIC /LIBRARY=LJDEVCTL2 Lowercase /OWNER=[DEVLPMNT,*] /PROCESSOR=LATSYM /PROTECTION=(S:E,O:D,G:E,W:W) /SCHEDULE=(NOSIZE)

Then create a new queue with matching qualifiers:

$ INITIALIZE/QUEUE/ON=ADMIN1::CHKPRT_TERM/DEFAULT=(FLAG=ONE, FORM=DEV1HP)/LIBRARY=LJDEVCTL2/PROCESSOR=LATSYM/SCHEDULE=(NOSIZE) /NOENABLE_GENERIC CHKPRT2

Make sure that you omit the extender .TLB from the filename of the library in the /LIBRARY= qualifier.

A common error condition while making setup modules is to have an error message appear on the terminal while printing and a message like "Module !AS not found..." (I forget the exact syntax) on a paper ejected from the printer. This occurs when the setup module defined in the form does not exist in the library specified by the queue. This can happen if you misname the module in the forms definition, misname the library in the queue definition, or accidentally put a .TLB extender in the library file specification of the queue definition.

To get a list of all the setup modules in a setup library, type

$ LIBRARY/LIST library-name


Written by Jason Goodman, September 23, 1994.