VISTA Printing Printer Subtypes

From VistApedia
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. This entry also includes 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") which 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 the number of lines available on the page, otherwise the printer will either spit out an extra page containing the extra lines, or it will clip the output, depending on whether you specified the number of lines 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 led 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 the SUPPRESS FORM FEED AT CLOSE field for every single printer you configure.

The same extra page issues apply to Zebra printers as well, except they may manifest as extra labels if IOF is configured to send a label feed command (^PH or ~PH). If IOF is configured to be a '#', it will have no effect on the Zebra printer.

How to Specify a Subtype?

Normally, subtypes are configured once per device. When you set up a printer in the DEVICE file, you populate the subtype in the subtype field.

However, you can override subtype selection on a job basis, by using this syntax on the Device prompt:

DEVICE: printer_name;subtype

If you type a partial match, the device driver (^%ZIS) is going to list all partial matches for you to choose from. That's pretty nice, since I never remember what subtypes I have beyond them having P-HP at the beginning.

There are variations on this syntax, by the way, that don't have to do with subtypes:

1. DEVICE: printer_name;right margin;page length
2. DEVICE: printer_name;subtype;right margin; page length
2. DEVICE: ;right margin;page length
3. DEVICE: ;;page length

As you can see, you can specify custom margins and page lengths. You need to remember that aside from terminal emulators, margins have no effect, as VISTA does not test for them when printing. It does really care about the page length though (see discussion about IOSL above). If a printer name isn't specified, the home device is assumed.

Novice power users type ';;99999' to print a report without page breaks on the terminal emulator, without understanding what it means. The variations above should tell you: print to the home device to an infinite length. Of note, $Y on Caché wraps at the unsigned int16 limit (32767); therefore, testing if $Y is greater than IOSL when IOSL is greater than 32767 (in my last example, it's 99999) will always return false, causing page breaks to never be issued. As far as I know, GT.M does not wrap $Y, so you may have to give it gigantic page lengths; although, in practice, I don't remember having encountered that problem. It's possible there is something in ^%ZIS4 that I missed regarding that.

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

PCL Subtypes

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 except 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 might 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="" W *27,"E"
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer

Greensheet

If you don't know what a greensheet is, then skip this. It's here for those who want it. You need to buy a barcode chip for the barcodes to print.

NAME: P-HP-LTR-POR-GREENSHEET      RIGHT MARGIN: 100
  FORM FEED: #                          PAGE LENGTH: 58
  BACK SPACE: $C(8)                     *OLD XY CRT: 60
  OPEN EXECUTE: W *27,"E",*27,"&k2G",*27,"&l0O",*27,"&l4H",*27,"&l1E",*27,"(s0p"
_$S($G(PSDCPI)=10:"10h14",1:"12h12")_"v0s0b6T" S ($X,$Y)=0
  CLOSE EXECUTE: S IONOFF="" W $C(27)_"E"
  10 PITCH: $C(27)_"(s10H"              12 PITCH: $C(27)_"(s12H"
  DESCRIPTION: HP JL4Si 12 pitch Courier
  DEFAULT LINES PER INCH: $C(27)_"&l8C"
  X LINES PER INCH: $C(27)_"&l12C"
  BAR CODE OFF: "*"_$C(27)_"&l0O"_$C(27)_"(8U"_$C(27)_"(s0p"_$S($G(PSDCPI)=10:"1
0h14",1:"12h12")_"v0s0b6T"
  BAR CODE ON: $S($D(PSDX2):$C(27)_"*p"_(PSDX2-1*300+200)_"y*p"_(PSDX1-1*810+38)
_"X",1:"")_$C(27)_"(0Y"_$C(27)_"(s0p8.1h12v0s0b0T*"

Pharmacy Outpatient Label Printer

This one is a bit specialized. This is normally set-up by running routines (in this sequence) ^PSOLLU2, ^PSOLLU3, ^PSOLLU4. You need to buy a barcode chip for the barcodes to print.

NAME: P-HPLJ4SI-P12                     SELECTABLE AT SIGN-ON: NO
  RIGHT MARGIN: 96                      FORM FEED: #
  PAGE LENGTH: 57                       BACK SPACE: $C(8)
  OPEN EXECUTE: W $C(27,69),$C(27),"&l0O",$C(27),"(0N",$C(27),"(s0p12h0s0b4099T"
 W $C(27),"&k2G" S $X=0                 DESCRIPTION: HP JL4Si 12 pitch Courier
NUMBER: 1                               CTRL CODE ABBREVIATION: ACI
  FULL NAME: ADDRESS CHANGE INITIALIZATION
  CONTROL CODE: S PSOHFONT="F12",PSOX=1210,PSOY=700,PSOFY=1270
NUMBER: 2                               CTRL CODE ABBREVIATION: ALI
  FULL NAME: ALLERGY SECTION INITIALIZATION
  CONTROL CODE: S PSOFONT="F10",PSOX=0,PSOY=1350,PSOYI=50,PSOYM=2700
NUMBER: 3                               CTRL CODE ABBREVIATION: AWI
  FULL NAME: ALLERGY WARNING INITIALIZATION
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT="F10"
NUMBER: 4                               CTRL CODE ABBREVIATION: BLB
  FULL NAME: BOTTLE LABEL BODY INITIALIZATION
  CONTROL CODE: S PSOX=0,PSODX=275,PSOY=140,PSOYI=40,PSOYM=379,PSOFONT="F10"
NUMBER: 5                               CTRL CODE ABBREVIATION: BLBC
  FULL NAME: BOTTLE LABEL BARCODE
  CONTROL CODE: W $C(27),"(s1p10.4v4,12b4,12s24670T",$C(27),"&a90P",$C(27),"*p36
50x1000Y"
NUMBER: 6                               CTRL CODE ABBREVIATION: BLF
  FULL NAME: BOTTLE LABEL FOOTER INITIALIZATION
  CONTROL CODE: S PSODY=460,PSOX=0,PSOCX=280,PSOQY=550,PSOTY=600,PSOFONT="F10",P
SOQFONT="F8",PSODFONT="F9",PSOTFONT="F10"
NUMBER: 7                               CTRL CODE ABBREVIATION: BLH
  FULL NAME: BOTTLE LABEL HEADER INITIALIZATION
  CONTROL CODE: S PSOX=100,PSOY=50,PSOYI=30,PSOFONT="F9"
NUMBER: 8                               CTRL CODE ABBREVIATION: CDII
  FULL NAME: CRITICAL DRUG INTERACTION INITIALIZATION
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT="F10"
NUMBER: 9                               CTRL CODE ABBREVIATION: CNI
  FULL NAME: COPAY NARRATIVE INITIALIZATION
  CONTROL CODE: S PSOY=2860,PSOX=1210,PSOYM=3950,PSOFONT="F10",PSOYI=50
NUMBER: 10                              CTRL CODE ABBREVIATION: EBLBC
  FULL NAME: END OF BOTTLE LABEL BARCODE
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p10v0s0b16602T",$C(27),"&a0P",!
NUMBER: 11                              CTRL CODE ABBREVIATION: EBT
  FULL NAME: END OF BARCODE TEXT
  CONTROL CODE: W $C(27),"(8U",$C(27),"(s1p8v0s0b16602T",!
NUMBER: 12                              CTRL CODE ABBREVIATION: F10
  FULL NAME: TEN POINT FONT - NO BOLD
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p10v0s0b16602T"
NUMBER: 13                              CTRL CODE ABBREVIATION: F10B
  FULL NAME: TEN POINT FONT, BOLDED
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p10v0s3b16602T"
NUMBER: 14                              CTRL CODE ABBREVIATION: F12
  FULL NAME: TWELVE POINT FONT - NO BOLD
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p12v0s0b16602T"
NUMBER: 15                              CTRL CODE ABBREVIATION: F12B
  FULL NAME: 12 POINT FONT BOLDED
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p12v0s3b16602T"
NUMBER: 16                              CTRL CODE ABBREVIATION: F6
  FULL NAME: SIX POINT FONT - NO BOLD
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p6v0s0b16602T"
NUMBER: 17                              CTRL CODE ABBREVIATION: F6B
  FULL NAME: SIX POINT FONT, BOLDED
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p6v0s3b16602T"
NUMBER: 18                              CTRL CODE ABBREVIATION: F8
  FULL NAME: EIGHT POINT FONT - NO BOLD
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p8v0s0b16602T"
NUMBER: 19                              CTRL CODE ABBREVIATION: F8B
  FULL NAME: EIGHT POINT FONT, BOLDED
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p8v0s3b16602T"
NUMBER: 20                              CTRL CODE ABBREVIATION: F9
  FULL NAME: NINE POINT FONT - NO BOLD
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p9v0s0b16602T"
NUMBER: 21                              CTRL CODE ABBREVIATION: F9B
  FULL NAME: NINE POINT FONT, BOLDED
  CONTROL CODE: W $C(27),"(10U",$C(27),"(s1p9v0s3b16602T"
NUMBER: 22                              CTRL CODE ABBREVIATION: FDU
  FULL NAME: FONT DISABLE UNDERLINE     CONTROL CODE: W $C(27),"&d@"
NUMBER: 23                              CTRL CODE ABBREVIATION: FWU
  FULL NAME: FONT WITH UNDERLINE        CONTROL CODE: W $C(27),"&d0D"
NUMBER: 24                              CTRL CODE ABBREVIATION: LL
  FULL NAME: LASER LABEL                CONTROL CODE: Q
NUMBER: 25                              CTRL CODE ABBREVIATION: LLI
  FULL NAME: LASER LABEL INIT
  CONTROL CODE: W $C(27),"&r1F",$C(27),"E",$C(27),"&l0O",$C(27),"&u300D",$C(27),
"&l3A",$C(27),"&l0E",!
NUMBER: 26                              CTRL CODE ABBREVIATION: MLI
  FULL NAME: MAILING LABEL INITIALIZATION
  CONTROL CODE: S PSOFONT="F10",PSOX=1680,PSOY=175,PSOYI=50
NUMBER: 27                              CTRL CODE ABBREVIATION: NR
  FULL NAME: NORMAL ROTATION            CONTROL CODE: W $C(27),"&a0P"
NUMBER: 28                              CTRL CODE ABBREVIATION: PFDI
  FULL NAME: PHARMACY FILL DOCUMENT INITIALIZATION
  CONTROL CODE: S PSOFONT="F10",PSOX=0,PSOY=690,PSOYI=40,PSOYM=969
NUMBER: 29                              CTRL CODE ABBREVIATION: PFDQ
  FULL NAME: PHARMACY FILL DOCUMENT QUANTITY
  CONTROL CODE: S PSOX=0,PSOCX=200,PSOY=970,PSOYI=50,PSOQFONT="F8",PSOFONT="F10"
NUMBER: 30                              CTRL CODE ABBREVIATION: PFDT
  FULL NAME: PHARMACY FILL DOCUMENT TRAILER
  CONTROL CODE: S PSOY=1015,PSOYI=45,PSOX=0,PSOFONT="F10",PSOBYI=50,PSOTFONT="F9
",PSOBY=1280
NUMBER: 31                              CTRL CODE ABBREVIATION: PFDW
  FULL NAME: PHARMACY FILL DOCUMENT WARNING
  CONTROL CODE: S PSOY=1258,PSOX=660,PSOYI=30,PSOFONT="F8",PSOYM=1329
NUMBER: 32                              CTRL CODE ABBREVIATION: PFI
  FULL NAME: PATIENT FILL INITIALIZATION
  CONTROL CODE: S PSOFONT="F10",PSOX=1210,PSOY=710,PSOYI=45,PSOHFONT="F12",PSOBY
I=100
NUMBER: 33                              CTRL CODE ABBREVIATION: PII
  FULL NAME: PATIENT INSTRUCTION INITIALIZATION
  CONTROL CODE: S PSOX=1210,PSOY=760,PSOFONT="F12"
NUMBER: 34                              CTRL CODE ABBREVIATION: PMII
  FULL NAME: PMI SECTION INITIALIZATION
  CONTROL CODE: S PSOX=0,PSOY=1350,PSOYI=50,PSOFONT="F10",PSOYM=3899
NUMBER: 35                              CTRL CODE ABBREVIATION: RMI
  FULL NAME: RETURN MAIL INITIALIZATION
  CONTROL CODE: S PSOHFONT="F8",PSOFONT="F10",PSOX=1680,PSOY=35,PSORYI=40,PSOHYI
=40,PSOTFONT="F8",PSOTY=550
NUMBER: 36                              CTRL CODE ABBREVIATION: RNI
  FULL NAME: REFILL NARRATIVE INITIALIZATION
  CONTROL CODE: S PSOY=2860,PSOFONT="F10",PSOX=0,PSOYI=50,PSOYM=3950
NUMBER: 37                              CTRL CODE ABBREVIATION: RPI
  FULL NAME: REFILL PRINT INITIALIZATION
  CONTROL CODE: S PSOFONT="F10",PSOBYI=65,PSOTYI=50,PSOLX=0,PSORX=1210,PSOY=1350
,PSOYM=3650,PSOXI=90,PSOSYI=135
NUMBER: 38                              CTRL CODE ABBREVIATION: RT
  FULL NAME: ROTATE TEXT                CONTROL CODE: W $C(27),"&a90P"
NUMBER: 39                              CTRL CODE ABBREVIATION: SBT
  FULL NAME: START OF BARCODE TEXT
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),"*p",PSOX,"x",PSOY,"Y",$C(27),"(s1p14
.4v6,18b6,18s24670T"
NUMBER: 40                              CTRL CODE ABBREVIATION: SPI
  FULL NAME: SUSPENSE PRINT INITIALIZATION
  CONTROL CODE: S PSOFONT="F10",PSOX=1210,PSOY=1350,PSOYI=50,PSOCX=1775,PSOYM=27
00
NUMBER: 41                              CTRL CODE ABBREVIATION: ST
  FULL NAME: START OF TEXT
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),"*p",PSOX,"x",PSOY,"Y"
NUMBER: 42                              CTRL CODE ABBREVIATION: WLI
  FULL NAME: WARNING LABEL INITIALIZATION
  CONTROL CODE: S PSOX=1050,PSOY=55

Zebra Subtypes

For whatever reason, all commercial implementations I have worked on used Zebra printers for labels. One IMPORTANT aspect to note is that the existing subtypes in VISTA are written for 203 dpi Zebra printers. If you print them on 300 dpi Zebra printers, they will look shrunken. In the subtypes below, Right Margin, Page Length, and Back Space have to be filled out because they are required fields, but the software doesn't use them.

ZPL II Commands Cheat Sheet

^XA - Start Label
^XZ - End Label
^LL - Label Length (Height)
^PW - Print Width
^CF - Set default Font
^LH - Label Home (Set a specific point to be the 0,0 coordinate for printing)
^A - Specify a font for the next ^FD (Field Definition). Resets to ^CF font after ^FD.
^CI - Change font encoding. 0 is USA-1, 28 is UTF-8, 30 is UTF-16 LE
^FR - Field Reverse Print; like reverse video for monitors
^FD - Field Data: contains what to print
^FS - Field Separator: End field data
^FB - Field Block: Allows you to print text with word wrapping
^BY - Bar Code Field Default: sets size of barcode.
^B3 - Code 39 barcode
^BC - Code 128 barcode
^BX - Datamatrix Barcode
^BQ - QR Barcode
^PH - Form Feed

Lab Label

This is 1" x 2".

NAME: P-ZEBRA-LAB
  RIGHT MARGIN: 132                     FORM FEED: #
  PAGE LENGTH: 64                       BACK SPACE: $C(8)
  OPEN EXECUTE: W "^XA^LL203.2^PW406.4^CFD,18,10^LH25,10"
  CLOSE EXECUTE: W "^XZ"                DESCRIPTION: Zebra Lab

Pharmacy BCMA Label

This is 1" x 3.5".

NAME: P-ZEBRA-PHARM-BCMA                
  RIGHT MARGIN: 80                      FORM FEED: #
  PAGE LENGTH: 10                       BACK SPACE: $C(8)
  OPEN EXECUTE: W "^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ"
NUMBER: 1                               CTRL CODE ABBREVIATION: SL
  FULL NAME: Start Label                CONTROL CODE: W !,"^XA",!,"^LH0,0^FS"
NUMBER: 2                               CTRL CODE ABBREVIATION: EL
  FULL NAME: End Label                  CONTROL CODE: W !,"^XZ"
NUMBER: 3                               CTRL CODE ABBREVIATION: EB
  FULL NAME: End Barcode
  CONTROL CODE: W !,"^FO20,150^A0N,30,20^CI13^FR^FD"_TEXT_"^FS"
NUMBER: 4                               CTRL CODE ABBREVIATION: SB
  FULL NAME: Start Barcode
  CONTROL CODE: W !,"^BY1,2.0^FO650,25^BXN,3,200^FD"_PSBBAR_"^FS"
NUMBER: 5                               CTRL CODE ABBREVIATION: ST
  FULL NAME: Start Text
  CONTROL CODE: W !,"^FO"_PSBTYPE_"^A0N,30,20^CI13^FR^FD"_TEXT_"^FS"
NUMBER: 6                               CTRL CODE ABBREVIATION: STF
  FULL NAME: Start Text Field
  CONTROL CODE: S PSBTYPE=$S(PSBTLE="PSBDRUG":"20,25",PSBTLE="PSBDOSE":"20,60^FB
320,5",PSBTLE="PSBNAME":"350,60",PSBTLE="PSBWARD":"350,90",PSBTLE="PSBLOT":"350,
120",PSBTLE="PSBEXP":"350,150",PSBTLE="PSBMFG":"500,150",PSBTLE="PSBFCB":"350,18
0",1:"0,0")

Pharmacy Unit Dose Label (vxVistA only)

VA VistA uses a dot matrix printer printing on a sheet of 1" x 3.5" x 2 columns. vxVistA was written to use Unit Dose labels. This is 1" x 3.5" single column.

NAME: P-ZEBRA-PHARM-UD
  RIGHT MARGIN: 132                     FORM FEED: #
  PAGE LENGTH: 64                       BACK SPACE: $C(8)
  OPEN EXECUTE: W "^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ"

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 your output on a print by print basis. E.g.:

LASER;P-LASER-LANDSCAPE;/M132L100P16BQ2

M stands for right margin, here set to 132; L stands for page length, here 100; P stands for pitch, here 16, can only be 10, 12 or 16; B stands for Bold; and Q stands for Quality, taking in 0, 1 or 2, here set to 2.

How to set up a device to support this isn't documented anywhere in the Kernel Manuals; I figured it out eventually by reading the %ZIS source code. You need to set up these fields as follows for each subtype:

  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"

The only thing you may have to vary between different subtypes is what is considered a default pitch. Here it is 12, but it can be different. Reading the code, I don't believe that setting the default pitch matters since the printer gets reset every single time a job is sent, discarding the last pitch sent. I don't support 'Q' in the configuration above, so it has no effect; that's because 'Q' is nonsensical when using laser printers. It had a use back in the dot-matrix days.