VISTA Printing Printer Subtypes

From VistApedia
Revision as of 18:19, 23 September 2016 by Shabiel (talk | contribs)
Jump to: navigation, search

VISTA Subtypes

Written by Sam Habiel

What is a Subtype

A subtype (stored in file #3.2 TERMINAL TYPE) is an entry associated with each device that tells the device how to handle special non-standard situations; plus some base characteristics. With printers, typically a subtype has two fields populated: Open Execute and Close Execute, in addition to Right Margin, Form Feed, Page Length, and Back Space. The Open Execute resets the printer, sets the page orientation, sets the top and left margins, and sets the font size. The close execute sets the variable IONOFF to an empty string (effectively defining it in the symbol table), and sends a reset to the printer. Right Margin and Back Space aren't used with printers; Form Feed goes into the M variable IOF, Page Length goes into the M variable IOSL ("IO Screen Length") determines how many lines are to be printed on each page before VISTA sends an IOF to go to the next page. That's important to keep in mind since the number of lines that VISTA prints needs to match how many lines are available on the page, otherwise the printer will either spit an extra page containing the extra lines or it will clip the output, depending on whether you specified how many lines are to be printed in PCL. The subtypes below don't specify how many lines to print, so the former behavior will happen with them. The solution is to decrease page length.

The reason IONOFF is needed is that by default VISTA will send an extra page following each print out; because it was developed in the days of dot-matrix printers, where the extra page separated jobs. The days of dot-matrix printing are practically over; most printers used today are inkjet or laser. Typically we don't want an extra page at the end. You may be lead to believe that IONOFF is enough; however, most reports in VISTA have hardcoded extra pages at the beginning or end. I was told there was going to be a project in the late 90's to make sure all reports relied on the device handler for printing separator pages, but that never happened.

There is a field in the device file called "SUPPRESS FORM FEED AT CLOSE". This field does the exact same thing as setting IONOFF in the Close Execute in the terminal type. In general, I recommend setting IONOFF in the terminal type rather than filling SUPPRESS FORM FEED AT CLOSE for every single printer you configure.

== How to specify a Subtype?

Common Subtypes in VISTA

Here are the most common subtypes in VISTA (standardized for Unices; you will need to remove $C(27),"&k2G" on Windows Servers):

NB: CPI = Characters Per Inch; LPI = Lines Per Inch

PCL5 Quick Reference

*27,"E"/$C(27,69) - Reset
*27,"&l0O" - Portrait / *27,"&l1O" - Landscape
*27,"&l3E" - Top Margin is 3 lines
*27,"&a5L" - Left Margin is 5 columns
*27,"&k2G" - Line endings are LF. Default Line endings are CRLF (unless overridden in printer settings).
*27,"(s0p12h0s0b4099T" - Primary '(s' font is fixed pitch, 12 cpi, upright (not italic), not bold, and is the Courier Font (#4099).

Portrait Letter 12 CPI 6 LPI

This is THE MOST COMMON subtype to use. Most reports in VISTA print on this one.

NAME: P-HP-LTR-POR-C12L6-W80           RIGHT MARGIN: 80
  FORM FEED: #                          PAGE LENGTH: 56
  BACK SPACE: $C(8)
  OPEN EXECUTE: W $C(27),"E",$C(27),"&l0O",$C(27),"&l3E",$C(27),"&a5L",$C(27),"&
k2G",*27,"(s0p12h0s0b4099T" S ($X,$Y)=0
  CLOSE EXECUTE: S IONOFF="" W *27,"E"
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer

Landscape Letter 14 CPI 6 LPI

This is the second most common subtype. Any menu option that says it needs 132 characters will need to use this subtype.

NAME: P-HP-LTR-LAND-C14L6-W132          RIGHT MARGIN: 132
  FORM FEED: #                          PAGE LENGTH: 45
  BACK SPACE: $C(8)
  OPEN EXECUTE: W $C(27,69),$C(27),"&l1O",$C(27),"&l3E",$C(27),"&a5L",$C(27),"&k
2G",*27,"(s0p14h0s0b4099T" S ($X,$Y)=0
  CLOSE EXECUTE: S IONOFF="" W $C(27)_"E"
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer

Portrait Letter 17 CPI 7 LPI (MARs and BCMA Med Log)

This is the (theoretically) third most commonly used subtype. It's only used for specific reports. It's also known as a condensed print subtype.

NAME: P-HP-LTR-POR-C17L7-W128           RIGHT MARGIN: 128
  FORM FEED: #                          PAGE LENGTH: 64
  BACK SPACE: $C(8)
  OPEN EXECUTE: W *27,"E",*27,"&k2G",*27,"&l3E",$C(27),"(s0p17h9v0s0b4099T",*27,
"&l7C" S ($X,$Y)=0
  CLOSE EXECUTE: S IONOFF="" W *27,"E"
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)

Portrait Landscape Letter 22 CPI 12 LPI

This is the subtype that will take the most amount of text; it's ideal to print a lot of data from Fileman, for example. It's also known as the condensed landscape print subtype. It's not commonly used expect by Fileman power users.

NAME: P-HP-LTR-LAND-C22L12-W228         RIGHT MARGIN: 228
  FORM FEED: #                          PAGE LENGTH: 88
  BACK SPACE: $C(8)
  OPEN EXECUTE: W $C(27,69),$C(27),"&l1O",$C(27),"&l4E",$C(27),"&l0D",$C(27),"&k
2G",*27,"(s0p22h0s0b4099T" S ($X,$Y)=0
  CLOSE EXECUTE: S IONOFF=""               W $C(27)_"E"
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)

Portrait Legal 12 CPI 6 LPI

This is not commonly used; I just created this because I thought it may it come in useful for some users.

 
NAME: P-HP-LGL-POR-C12L6-W80           RIGHT MARGIN: 80
  FORM FEED: #                          PAGE LENGTH: 74
  BACK SPACE: $C(8)
  OPEN EXECUTE: W $C(27),"E",$C(27),"&l3A",$C(27),"&l0O",$C(27),"&l3E",$C(27),"&
a5L",$C(27),"&k2G",*27,"(s0p12h0s0b4099T" S ($X,$Y)=0
  CLOSE EXECUTE: S IONOFF="",JNYMRMFF="",JNYM2PS="" W *27,"E"
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer

Support for Advanced Subtype Specifiers

If you look at kernel system management guide, you will notice that you can use a rather obtuse syntax to customize various aspects of how your output looks like.

e.g.

LASER;P-LASER-LANDSCAPE;/M132L100P16BQ2

Add support like this.

  10 PITCH: $C(27)_"(s10h"              12 PITCH: $C(27)_"(s12h"
  HIGH INTENSITY (BOLD): $C(27)_"(s3b"  LOW INTENSITY (UNBOLD): $C(27)_"(s-3b"
  NORMAL INTENSITY (RESET): $C(27)_"(s0b"
  16 PITCH: $C(27)_"(s16h"              DEFAULT PITCH: $C(27)_"(s12h"