<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://vistapedia.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lindamry</id>
	<title>VistApedia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://vistapedia.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lindamry"/>
	<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php/Special:Contributions/Lindamry"/>
	<updated>2026-04-24T09:02:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://vistapedia.com/index.php?title=Setting_up_a_VISTA_Printer&amp;diff=17210</id>
		<title>Setting up a VISTA Printer</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=Setting_up_a_VISTA_Printer&amp;diff=17210"/>
		<updated>2016-10-24T23:39:29Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Setting Up a Printer in VISTA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Programming VistA Issues]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
This is an updated page. See [[Setting_up_a_Linux_Printer_Old|this page]] for old content.&lt;br /&gt;
&lt;br /&gt;
== Setting Up a Printer in VISTA ==&lt;br /&gt;
In order to set-up a printer in VISTA, there are three steps:&lt;br /&gt;
&lt;br /&gt;
* Add printer to CUPS or to Windows Printer list. The printers may be on remote servers, as long as the VISTA machine can access them.&lt;br /&gt;
* In VISTA, you need to create an entry that represents the printer formatting characteristics in the terminal type file (#3.2)&lt;br /&gt;
* Then you need to create an entry in the device file (#3.5) that corresponds to the printer&lt;br /&gt;
&lt;br /&gt;
In practice, you don&#039;t need to do the second step because there are only about 5 commonly used subtypes in VISTA which you reuse.&lt;br /&gt;
&lt;br /&gt;
A Subtype is a file entry that contains the code to send to the printer, to open the printer, reset the printer, select the page size, adjust the margins, select the font etc.&lt;br /&gt;
&lt;br /&gt;
=== Subtypes ===&lt;br /&gt;
&lt;br /&gt;
Information about subtypes, including the most common subtypes, is listed [[VISTA_Printing_Printer_Subtypes|here]].&lt;br /&gt;
&lt;br /&gt;
=== Caché/Windows Printing ===&lt;br /&gt;
When you specify a printer name in $I, Caché/Windows sends raw input directly to the printer, bypassing the driver. This makes setting up a printer on Windows easy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: BROTHER                           $I: |PRN|\\VXQA\HL2270DW&lt;br /&gt;
  LOCATION OF TERMINAL: QA              SUBTYPE: P-HP-LASER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, all you have to do is put the printer name after |PRN| in $I. You can specify local printers; or you can specify shared printers using a UNC path (as shown above).&lt;br /&gt;
&lt;br /&gt;
=== Caché/Linux Printing ===&lt;br /&gt;
You can use Pipes in Cache to print on Linux/Unix. Here&#039;s an operative example. Based on my experience, this is the best way to do it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM&#039;S PHARMACY PRINTER            $I: /usr/bin/lpr -PSAN_FL6 -l&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;QW&amp;quot;                 SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that there is a bug in DEVOK^%ZOSV (ZOSVONT) that prevents it from checking the device properly. This will show up if you misconfigure a device and then use it in Taskman. Short of fixing this, here is how to remove the bad prints from Taskman:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S (DEV,ZTIME,ZTSK)=&amp;quot;&amp;quot; F  S DEV=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV)) Q:DEV=&amp;quot;&amp;quot;  F  S ZTIME=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV,ZTIME)) Q:&#039;ZTIME  F  S ZTSK=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV,ZTIME,ZTSK)) Q:&#039;ZTSK  D DQ^%ZTLOAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the method developed but not adopted by the VA in patch [http://foia-vista.osehra.org/Patches_By_Application/XU-KERNEL/XU-8_SEQ-485_PAT-585.TXT XU*8.0*585]. After attempting to use this method in production, I would recommend against it, because a. CPRS and BCMA code is not configured to pick up PQ devices and b. %ZISC has issues with PQ devices. I have fixed both of these issues; but the code for this is not in VISTA yet.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample device that uses the XU*8.0*585 method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PRINTER_NAME                          $I: PRINTER_NAME&lt;br /&gt;
  PURGE OLD PRINT QUEUE FILES: YES      LOCATION OF TERMINAL: Cups Device&lt;br /&gt;
  SUBTYPE: P-HP-LTR-POR-C17L7-W128-NOFF TYPE: PRINT QUEUE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GT.M/Linux Printing ===&lt;br /&gt;
Pipes again; just like Cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em&amp;quot;&amp;gt;&lt;br /&gt;
NAME: PHAR-IP-DM                        $I: PHAR-IP-DM&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Dot-Matrix&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -l -P PHAR-IP-DM 2&amp;gt;/dev/null&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
  SUBTYPE: P-EPSON-DM-P15-5L&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-LS                        $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Landscape&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
  SUBTYPE: P-HPLJ4SI-P13-LS&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-POR-P12                   $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Portrait (PL)&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
MNEMONIC: PL&lt;br /&gt;
  SUBTYPE: P-HPLJ4SI-P12                TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-POR-P16                   $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Portrait (MAR)&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
MNEMONIC: MAR&lt;br /&gt;
  SUBTYPE: P-HPLJ2-P16                  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How Does Printing from VISTA Work? ===&lt;br /&gt;
How does this work?&lt;br /&gt;
The way this works is that $I becomes the IO variable. The open&lt;br /&gt;
parameters tells VISTA how to open the device.&lt;br /&gt;
&lt;br /&gt;
Vista does this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S IO=[$I]&lt;br /&gt;
S param=[OPEN PARAMETERS]&lt;br /&gt;
O IO:param&lt;br /&gt;
U IO&lt;br /&gt;
Send Open Execute from Subtype&lt;br /&gt;
U IO(0)&lt;br /&gt;
Interact with user; open another job, etc...&lt;br /&gt;
U IO&lt;br /&gt;
write write write&lt;br /&gt;
Send Close Execute from Subtype&lt;br /&gt;
C IO&lt;br /&gt;
etc.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No need to do pre-open and post-close executes on the device which dynamically changes IOs.&lt;br /&gt;
&lt;br /&gt;
=== Avoiding the Staircase Effect When Printing from GT.M/Caché on *Nix with Laser Printers ===&lt;br /&gt;
For an explanation of the Staircase effect, see this:&lt;br /&gt;
http://www.digitalissues.co.uk/html/os/unix/stair.html&lt;br /&gt;
&lt;br /&gt;
Basically, the new line doesn&#039;t include a carriage return, so our output just flows off the page. So when you print a 10 line document, you may only see one line, as the rest was printed outside of the margin.&lt;br /&gt;
&lt;br /&gt;
If you are sending raw output (lpr with the -l option) from VISTA to any PCL compatible printer (and VISTA by and large uses PCL for formatting plain text output), you need to add this to your open execute:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em&amp;quot;&amp;gt;&lt;br /&gt;
W $C(27),&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the PCL compatible printer to append a CR to each LF or FF.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you are asking CUPS to handle the formatting (lpr without the -l option), CUPS properly formats the line returns through a CUPS filter, so you don&#039;t have to do anything.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Printing Topics ===&lt;br /&gt;
[[VISTA_Advanced_printing_topics|Advanced printing topics]]&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=Setting_up_a_VISTA_Printer&amp;diff=17209</id>
		<title>Setting up a VISTA Printer</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=Setting_up_a_VISTA_Printer&amp;diff=17209"/>
		<updated>2016-10-24T23:37:59Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Setting Up a Printer in VISTA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Programming VistA Issues]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
This is an updated page. See [[Setting_up_a_Linux_Printer_Old|this page]] for old content.&lt;br /&gt;
&lt;br /&gt;
== Setting Up a Printer in VISTA ==&lt;br /&gt;
In order to set-up a printer in VISTA, there are three steps:&lt;br /&gt;
&lt;br /&gt;
* Add printer to CUPS or to Windows Printer list. The printers may be on remote servers, as long as the VISTA machine can access them.&lt;br /&gt;
* In VISTA, you need to create an entry that represents the printer formatting characteristics in the terminal type file (#3.2)&lt;br /&gt;
* Then you need to create an entry in the device file (#3.5) that corresponds to the printer&lt;br /&gt;
&lt;br /&gt;
In practice, you don&#039;t need to do the second step because there are only about 5 commonly used subtypes in VISTA which you reuse.&lt;br /&gt;
&lt;br /&gt;
A Subtype is a file entry that contains the code to send to the printer, to open the printer, reset the printer, select the page size, adjust the margins, select the font etc.&lt;br /&gt;
&lt;br /&gt;
=== Subtypes ===&lt;br /&gt;
&lt;br /&gt;
Information about subtypes, including the most common subtypes, is listed [[VISTA_Printing_Printer_Subtypes|here]].&lt;br /&gt;
&lt;br /&gt;
=== Cache/Windows printing ===&lt;br /&gt;
When you specify a printer name in $I, Cache/Windows sends raw input directly to the printer, bypassing the driver. This makes setting up a printer on Windows easy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: BROTHER                           $I: |PRN|\\VXQA\HL2270DW&lt;br /&gt;
  LOCATION OF TERMINAL: QA              SUBTYPE: P-HP-LASER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, all you have to do is put the printer name after |PRN| in $I. You can specify local printers; or you can specify shared printers using a UNC path (as shown above).&lt;br /&gt;
&lt;br /&gt;
=== Caché/Linux printing ===&lt;br /&gt;
You can use Pipes in Cache to print on Linux/Unix. Here&#039;s an operative example. Based on my experience, this is the best way to do it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM&#039;S PHARMACY PRINTER            $I: /usr/bin/lpr -PSAN_FL6 -l&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;QW&amp;quot;                 SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that there is a bug in DEVOK^%ZOSV (ZOSVONT) that prevents it from checking the device properly. This will show up if you misconfigure a device and then use it in Taskman. Short of fixing this, here is how to remove the bad prints from Taskman:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S (DEV,ZTIME,ZTSK)=&amp;quot;&amp;quot; F  S DEV=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV)) Q:DEV=&amp;quot;&amp;quot;  F  S ZTIME=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV,ZTIME)) Q:&#039;ZTIME  F  S ZTSK=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV,ZTIME,ZTSK)) Q:&#039;ZTSK  D DQ^%ZTLOAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the method developed but not adopted by the VA in patch [http://foia-vista.osehra.org/Patches_By_Application/XU-KERNEL/XU-8_SEQ-485_PAT-585.TXT XU*8.0*585]. After attempting to use this method in production, I would recommend against it, because a. CPRS and BCMA code is not configured to pick up PQ devices and b. %ZISC has issues with PQ devices. I have fixed both of these issues; but the code for this is not in VISTA yet.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample device that uses the XU*8.0*585 method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PRINTER_NAME                          $I: PRINTER_NAME&lt;br /&gt;
  PURGE OLD PRINT QUEUE FILES: YES      LOCATION OF TERMINAL: Cups Device&lt;br /&gt;
  SUBTYPE: P-HP-LTR-POR-C17L7-W128-NOFF TYPE: PRINT QUEUE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GT.M/Linux Printing ===&lt;br /&gt;
Pipes again; just like Cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em&amp;quot;&amp;gt;&lt;br /&gt;
NAME: PHAR-IP-DM                        $I: PHAR-IP-DM&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Dot-Matrix&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -l -P PHAR-IP-DM 2&amp;gt;/dev/null&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
  SUBTYPE: P-EPSON-DM-P15-5L&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-LS                        $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Landscape&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
  SUBTYPE: P-HPLJ4SI-P13-LS&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-POR-P12                   $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Portrait (PL)&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
MNEMONIC: PL&lt;br /&gt;
  SUBTYPE: P-HPLJ4SI-P12                TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-POR-P16                   $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Portrait (MAR)&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
MNEMONIC: MAR&lt;br /&gt;
  SUBTYPE: P-HPLJ2-P16                  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How Does Printing from VISTA Work? ===&lt;br /&gt;
How does this work?&lt;br /&gt;
The way this works is that $I becomes the IO variable. The open&lt;br /&gt;
parameters tells VISTA how to open the device.&lt;br /&gt;
&lt;br /&gt;
Vista does this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S IO=[$I]&lt;br /&gt;
S param=[OPEN PARAMETERS]&lt;br /&gt;
O IO:param&lt;br /&gt;
U IO&lt;br /&gt;
Send Open Execute from Subtype&lt;br /&gt;
U IO(0)&lt;br /&gt;
Interact with user; open another job, etc...&lt;br /&gt;
U IO&lt;br /&gt;
write write write&lt;br /&gt;
Send Close Execute from Subtype&lt;br /&gt;
C IO&lt;br /&gt;
etc.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No need to do pre-open and post-close executes on the device which dynamically changes IOs.&lt;br /&gt;
&lt;br /&gt;
=== Avoiding the Staircase Effect When Printing from GT.M/Caché on *Nix with Laser Printers ===&lt;br /&gt;
For an explanation of the Staircase effect, see this:&lt;br /&gt;
http://www.digitalissues.co.uk/html/os/unix/stair.html&lt;br /&gt;
&lt;br /&gt;
Basically, the new line doesn&#039;t include a carriage return, so our output just flows off the page. So when you print a 10 line document, you may only see one line, as the rest was printed outside of the margin.&lt;br /&gt;
&lt;br /&gt;
If you are sending raw output (lpr with the -l option) from VISTA to any PCL compatible printer (and VISTA by and large uses PCL for formatting plain text output), you need to add this to your open execute:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em&amp;quot;&amp;gt;&lt;br /&gt;
W $C(27),&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the PCL compatible printer to append a CR to each LF or FF.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you are asking CUPS to handle the formatting (lpr without the -l option), CUPS properly formats the line returns through a CUPS filter, so you don&#039;t have to do anything.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Printing Topics ===&lt;br /&gt;
[[VISTA_Advanced_printing_topics|Advanced printing topics]]&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17208</id>
		<title>VISTA Advanced printing topics</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17208"/>
		<updated>2016-10-24T23:34:45Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Advanced Printing Topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Advanced Printing Topics =&lt;br /&gt;
Authored mainly by Sam Habiel, the printer &amp;quot;sensei.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How do Computers Communicate with Printers, Software-wise? ==&lt;br /&gt;
This is a pretty difficult topic. Cheaper printers only accept binary data that is hardcoded by the computers; typically these printers are only supported on Windows, and thus are named &amp;quot;Winprinters.&amp;quot; Higher end printers have a processor on them that can typically interpret PCL5, PCL6, and PS; and possibly PDF. These printers are easily supported in Linux. Commercial label printers (like Zebras) always accept their own programming language.&lt;br /&gt;
&lt;br /&gt;
== VISTA and What It Really Sends ==&lt;br /&gt;
VISTA sends PCL5 to laser printers; or a printer specific language for label printers--most commonly ZPL II for Zebra printers. For laser printers, you need to make sure that your printer supports PCL5. All HP Printers support PCL5, no matter how cheap; other manufacturers only support it on their higher end printers (not too high end--anything that isn&#039;t the cheapest printer may support PCL5). If you need to look it up, go to the manufacturer&#039;s website and look at the technical specs sheet. The section is typically called &amp;quot;supported emulations,&amp;quot; or &amp;quot;supported languages.&amp;quot; What VISTA sends is determined by the sub-type defined for the device.&lt;br /&gt;
&lt;br /&gt;
== Communicating with a Printer on the Network for the First Time ==&lt;br /&gt;
Nothing prevents you from using a USB printer or even a parallel port printer, but in my experience, nobody uses those interfaces in production anymore.&lt;br /&gt;
&lt;br /&gt;
Get the IP address first. You can usually obtain that by printing an information sheet from the printer. Consult the printer manual to find out how to print that information sheet. You can also try to identify the printer from the list of connected hosts on your network.&lt;br /&gt;
&lt;br /&gt;
Whenever I set up a new printer, I tend to ensure that I can talk to it directly, with nothing in the middle. I use the netcat command (&#039;nc&#039;) to do that, connecting to the IP address of the printer on port 9100. Make sure to add the -v flag to netcat so that it can report whether it succeeded in connecting at all. It is very possible that you connected to a printer but you just don&#039;t know which one.&lt;br /&gt;
&lt;br /&gt;
(Aside: This can be done from VISTA using D CALL^%ZISTCP(ip_address,port,time_out)--but netcat is easier.)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of me trying to talk to a PCL printer, so it will print the word &amp;quot;test&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;TEST&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and here&#039;s an example printing a Datamatrix code on a Zebra printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;^XA^FO50,100^BXN,10,200^FDTESTTEST^FS^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A successful connection will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Connection to XX.XX.XX.XX 9100 port [tcp/jetdirect] succeeded!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An unsuccessful connection will either just hang or tell you connection refused.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nc: connect to XXXXXXXXX port 9100 (tcp) failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Printer in the Operating System ==&lt;br /&gt;
After confirming the connection, you need to set up the printer in the operating system. VISTA does NOT need any drivers for the printers to be installed.&lt;br /&gt;
&lt;br /&gt;
== Setting Up a Printer in VISTA ==&lt;br /&gt;
See [[Setting_up_a_VISTA_Printer|this page]].&lt;br /&gt;
&lt;br /&gt;
== Testing Printers ==&lt;br /&gt;
To test printers in VISTA after setting it up, there are a few steps you have to go through.&lt;br /&gt;
&lt;br /&gt;
If you run this on Caché, Caché steals your IO device between prompts. Therefore U IO to D ^%ZISC need to be on a single line. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U IO W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Invoke via %ZIS first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
D ^%ZIS&lt;br /&gt;
&lt;br /&gt;
DEVICE: HOME//MY PRINTER&lt;br /&gt;
&lt;br /&gt;
U IO&lt;br /&gt;
&lt;br /&gt;
W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the output. If it&#039;s okay, you are ready to move to the next step. If you see the &amp;quot;staircase&amp;quot; effect, you need to go back and set-up the terminal type correctly [[Setting_up_a_Linux_Printer|here]].&lt;br /&gt;
&lt;br /&gt;
The next menu option to try is Send Test Pattern to Terminal [XUTTEST]. If that works, then you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Various Troubleshooting Topics -- How Fun! ==&lt;br /&gt;
There are various issues that come up regularly with VISTA.&lt;br /&gt;
&lt;br /&gt;
=== Laser Printer Issues ===&lt;br /&gt;
Use this page as a reference for PCL:&lt;br /&gt;
&lt;br /&gt;
http://www.pclviewer.com/resources/reference/&lt;br /&gt;
&lt;br /&gt;
==== Extra Pages ====&lt;br /&gt;
Extra pages can happen for three different reasons:&lt;br /&gt;
 &lt;br /&gt;
* By default, VISTA prints an extra page after each print job. This is for historical reasons; as most of the early printers were dot-matrix. Today, it&#039;s recommended that this be disabled. To disable the extra page, you can do it at the device level or the terminal type level. At the device level, set &amp;lt;code&amp;gt;SUPPRESS FORM FEED AT CLOSE&amp;lt;/code&amp;gt; to yes. For the terminal type, set &amp;lt;code&amp;gt;CLOSE EXECUTE&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* The text doesn&#039;t fit the page and spills over to the next page. VISTA printing options must follow the IOSL value (Page Length in Terminal Type or Device--Device overrides Terminal Type). Most of the time this has to do with the fact that the text size for the report is too large; or that the margins are not appropriate. Based on visual inspection, you should decide what to do. The unlikely case is that the VISTA programmer is not obeying IOSL; but that is for you to determine.&lt;br /&gt;
* If both of the above fail, it&#039;s likely that VISTA sends a hard coded form feed to the printer. You need to capture the output by capturing the print to a file (use HFS;subtype) and visually examine it in a programming editor.&lt;br /&gt;
&lt;br /&gt;
==== Wrapping ====&lt;br /&gt;
Typically this has to do with whether the printer is configured to take 132 characters or 80 characters; if not, then it has to do with the font size.&lt;br /&gt;
&lt;br /&gt;
VISTA has these typical formats for printing:&lt;br /&gt;
&lt;br /&gt;
* 12 cpi 8 lpi Portrait (most reports)&lt;br /&gt;
* 17 cpi 7 lpi Portrait (MAR)&lt;br /&gt;
* 14 cpi 6 lpi Landscape (132 wide reports)&lt;br /&gt;
* 22 cpi 12 lpi Landscape (228 wide reports)&lt;br /&gt;
&lt;br /&gt;
==== Only a Single Line Prints ====&lt;br /&gt;
You are seeing the staircase effect. See the Staircase section in [[Setting_up_a_VISTA_Printer]].&lt;br /&gt;
&lt;br /&gt;
=== Zebra Printer Issues ===&lt;br /&gt;
From my memory, these are typically the issues you face:&lt;br /&gt;
&lt;br /&gt;
* Label not aligned vertically&lt;br /&gt;
* Label not aligned horizontally&lt;br /&gt;
* Labels are not dark enough.&lt;br /&gt;
* Label gets cut off&lt;br /&gt;
* VISTA printed labels are too small&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned vertically ====&lt;br /&gt;
Zebras mostly auto calibrate printing on continuous media. Check your Zebra&#039;s manual on how to do that for the specific model.&lt;br /&gt;
&lt;br /&gt;
==== Label not Aligned Horizontally ====&lt;br /&gt;
Zebras don&#039;t auto align to the width. You have to set the print width yourself. They can detect the start of the label though.&lt;br /&gt;
&lt;br /&gt;
To do that, find your printer dpi setting, and multiply that by the width of your label. E.g. 202 dpi with 3.5&amp;quot;, you need to run this command from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA^PW707^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn&#039;t solve your problem, you need to look carefully at the actual feeding of the label into the zebra printer. Read the manual carefully. I have seen many people &amp;quot;wing it&amp;quot; and do it incorrectly. I have even seen a printer where the left margin guide wasn&#039;t used and a rubber band was placed there. After you turn off or restart the printer, it tries to self calibrate.&lt;br /&gt;
&lt;br /&gt;
==== Label Text is Not Dark Enough ====&lt;br /&gt;
There are two tunable circle things on the top of the print head that can be turned to increase the darkness. Try that. There is also a Zebra setting that can be changed to increase the darkness.&lt;br /&gt;
&lt;br /&gt;
==== Label Gets Cut Off ====&lt;br /&gt;
If the label gets cut off on the right hand side of the label, check your print width (see &#039;Label not aligned horizontally&#039;), and if that&#039;s not the issue, check the position of the ribbon vis a vis the labels. The printer may be trying to print, but there is no ribbon at the place it&#039;s trying to print. If it is getting cut off from the left side, check that your labels are using the left hand guide and are not colliding with it. If it is getting cut off vertically, you need to calibrate the printer. If it still gets cut off, you need to capture the ZPL II that is sent by VISTA and see 1. that it&#039;s formatted correctly and 2. that there isn&#039;t too much information to print.&lt;br /&gt;
&lt;br /&gt;
==== VISTA Printed Labels are too Small ====&lt;br /&gt;
This means that you bought a Zebra printer with the wrong dpi. You have to return it and buy another one. VISTA wants printers with 202 DPI. If you want to use the new printer, you need to re-write some of the label code.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Troubleshooting ===&lt;br /&gt;
If you are stuck with a particularly difficult problem, it may be useful to capture the PCL and use a PCL emulator and print to a PDF; or ZPL II and use a Zebra emulator.&lt;br /&gt;
&lt;br /&gt;
To capture an output from VISTA, you need to create a device whose type is HFS but whose destination is pre-determined. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM-DIRECT-HFS-PRINTER            $I: /tmp/op-dev6-lbl-sam.pcl&lt;br /&gt;
  LOCATION OF TERMINAL: File&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;NWS&amp;quot;                SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: HOST FILE SERVER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to change the file for each job, so that they won&#039;t overwrite each other, you can append something to IO in the pre-open execute. Please note that you need to change &amp;quot;NWS&amp;quot; to (newversion) on GT.M.&lt;br /&gt;
&lt;br /&gt;
This is the emulator I use for PCL, http://www.ghostscript.com/GhostPCL.html.&lt;br /&gt;
This is the emulator I use for ZPL II, http://labelary.com/viewer.html&lt;br /&gt;
&lt;br /&gt;
To use GhostPCL, here is a sample invocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat vista_print-0001.pcl | C:\Users\shabiel\workspace\ghostpcl-9.15-win32\pcl6-9.15-win32.exe -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -r600 -sOutputFile=&amp;quot;testpdf.sam&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical PCL String ==&lt;br /&gt;
To construct a PCL in VISTA, you typically put everything in the Open Execute. The Close Execute should always be set to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt; unless you want to do something special. The Form Feed accepts PCL as well.&lt;br /&gt;
&lt;br /&gt;
The typical PCL sequence for an Open Execute is as follows:&lt;br /&gt;
&lt;br /&gt;
* Reset&lt;br /&gt;
* Set Line Carriage mode (CR, CRLF, or LF)&lt;br /&gt;
* Set Orientation (Portrait or Landscape)&lt;br /&gt;
* Set Character Set (optional; not needed for US printing; may need to change for Spanish)&lt;br /&gt;
* Set Margins (optional; but you will probably need it at some point)&lt;br /&gt;
* Set Font&lt;br /&gt;
&lt;br /&gt;
When constructing a string, I recommend using *27 rather than $C(27) because it&#039;s shorter, and you will type a lot of it.&lt;br /&gt;
&lt;br /&gt;
An example. Note that this needs to be all in one string. It&#039;s separated here for education.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W *27,&amp;quot;E&amp;quot;    ; Reset&lt;br /&gt;
W *27,&amp;quot;&amp;amp;k2G&amp;quot; ; Set Carriage mode to LF.&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l0O&amp;quot; ; Portrait; Landscape is 1O.&lt;br /&gt;
...          ; Character Set Omitted&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l4E&amp;quot; ; Top Margin 4 lines&lt;br /&gt;
W *27,&amp;quot;&amp;amp;a5L&amp;quot; ; Left Margin 5 columns&lt;br /&gt;
W *27,&amp;quot;(s0p12h0s0b4099T&amp;quot; ; Fixed Pitch; 12 cpi, fixed pitch for secondary font, Medium Weight, select courier font.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Functions ==&lt;br /&gt;
I won&#039;t document this in detail, but here are some advanced examples. These ones do headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80-HD         RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p12h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5&lt;br /&gt;
L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h&lt;br /&gt;
0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot; S ($X,$&lt;br /&gt;
Y)=0                                    CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128-HD        RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p17h9v0s0b0T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;l7C&amp;quot;_$C(27&lt;br /&gt;
)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;#&amp;quot;,&amp;quot;&amp;quot;)                     PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(2&lt;br /&gt;
7),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,*27,&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&lt;br /&gt;
(s0p17h9v0s0b0T&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27,69)&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228-HD      RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p22h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p22h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132-HD       RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p14h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 46&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p14h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this one does a watermark:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-PORTRAIT-C16L7-WM            SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96&lt;br /&gt;
  FORM FEED: $c(27)_&amp;quot;*c5760x6000Y&amp;quot;_$c(27)_&amp;quot;*p150x150Y&amp;quot;_$c(27)_&amp;quot;*c0T&amp;quot;_$c(27)_&amp;quot;%1B&lt;br /&gt;
IN;SP1;DI1,-1;SD2,1,4,140,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;_$c&lt;br /&gt;
(3,27)_&amp;quot;%1A&amp;quot;_$c(12)                     PAGE LENGTH: 60&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;(8U&amp;quot;,*27,&amp;quot;(s0P&amp;quot;,*27,&amp;quot;(s16H&amp;quot;,*27,&amp;quot;(s9V&amp;quot;,*27,&amp;quot;(s0S&amp;quot;&lt;br /&gt;
,*27,&amp;quot;(s-3B&amp;quot;,*27,&amp;quot;(s0T&amp;quot;,*27,&amp;quot;&amp;amp;l88P&amp;quot;,*27,&amp;quot;&amp;amp;a255M&amp;quot;,*27,&amp;quot;&amp;amp;k2S&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot;,*27,&amp;quot;&amp;amp;s1C&lt;br /&gt;
&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W *27,&amp;quot;*c5760x6000Y&amp;quot;,*27,&amp;quot;*p150x150Y&amp;quot;,*27,&amp;quot;*c0T&amp;quot;,*27,&amp;quot;%1B&amp;quot;,&amp;quot;IN;&lt;br /&gt;
SP1;DI1,-1;SD1,21,2,1,4,140,5,0,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;&lt;br /&gt;
_$C(3),*27,&amp;quot;%1A&amp;quot;                     DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing PDFs from VISTA ==&lt;br /&gt;
Using GhostPCL, you can directly print out a PDF from VISTA. Here&#039;s an example in GT.M on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PDF WRITER                        $I: PDF-WRITER&lt;br /&gt;
  LOCATION OF TERMINAL: /tmp/           &lt;br /&gt;
  OPEN PARAMETERS: (comm=&amp;quot;pcl6 -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -SOutputFile=&lt;br /&gt;
/tmp/green-sheet.pdf -&amp;quot;)::&amp;quot;pipe&amp;quot;        SUBTYPE: P-HP BARCODER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, you can add a Windows printer that automatically calls GhostPCL. You need to use this amazing piece of software:&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/mfilemon/&lt;br /&gt;
&lt;br /&gt;
Once you install it and configure it, you need to set the $I appropriately.&lt;br /&gt;
&lt;br /&gt;
== Finding the TCP/IP address for a print queue name ==&lt;br /&gt;
On Linux, the lpstat command tells you details about the print queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -v&lt;br /&gt;
&lt;br /&gt;
device for TEST-01: socket://192.168.10.3:9100&lt;br /&gt;
&lt;br /&gt;
device for TEST-02: socket://192.168.10.4:9100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the Ready Status of a Print Queue ==&lt;br /&gt;
&lt;br /&gt;
On Linux, the lpstat command tells you all the printers and what their status is.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -a&lt;br /&gt;
&lt;br /&gt;
TEST-01 accepting requests since Sun 25 Dec 2005 09:54:34 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-02 accepting requests since Thu 28 Nov 2013 09:56:11 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-03 accepting requests since Fri 17 Mar 2017 10:03:00 AM EST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or for a particular printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -p  TEST-03&lt;br /&gt;
&lt;br /&gt;
printer TEST-03 is idle.  enabled since Fri 17 Mar 2017 08:39:00 AM EDT&lt;br /&gt;
        Ready to print.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17207</id>
		<title>VISTA Printing Printer Subtypes</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17207"/>
		<updated>2016-10-24T23:14:41Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Zebra Subtypes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= VISTA Subtypes =&lt;br /&gt;
&#039;&#039;Written by Sam Habiel&#039;&#039;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== What is a Subtype ==&lt;br /&gt;
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&#039;t used with printers; Form Feed goes into the M variable IOF, Page Length goes into the M variable IOSL (&amp;quot;IO Screen Length&amp;quot;) which determines how many lines are to be printed on each page before VISTA sends an IOF to go to the next page. That&#039;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&#039;t specify how many lines to print, so the former behavior will happen with them. The solution is to decrease page length.&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;s to make sure all reports relied on the device handler for printing separator pages, but that never happened.&lt;br /&gt;
&lt;br /&gt;
There is a field in the device file called &amp;quot;SUPPRESS FORM FEED AT CLOSE&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
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 &#039;#&#039;, it will have no effect on the Zebra printer.&lt;br /&gt;
&lt;br /&gt;
== How to Specify a Subtype? ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
However, you can override subtype selection on a job basis, by using this syntax on the Device prompt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE: printer_name;subtype&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you type a partial match, the device driver (^%ZIS) is going to list all partial matches for you to choose from. That&#039;s pretty nice, since I never remember what subtypes I have beyond them having P-HP at the beginning.&lt;br /&gt;
&lt;br /&gt;
There are variations on this syntax, by the way, that don&#039;t have to do with subtypes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. DEVICE: printer_name;right margin;page length&lt;br /&gt;
2. DEVICE: printer_name;subtype;right margin; page length&lt;br /&gt;
2. DEVICE: ;right margin;page length&lt;br /&gt;
3. DEVICE: ;;page length&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;t specified, the home device is assumed.&lt;br /&gt;
&lt;br /&gt;
Novice power users type &#039;;;99999&#039; 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&#039;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&#039;t remember having encountered that problem. It&#039;s possible there is something in ^%ZIS4 that I missed regarding that.&lt;br /&gt;
&lt;br /&gt;
== Common Subtypes in VISTA ==&lt;br /&gt;
Here are the most common subtypes in VISTA (standardized for Unices; you will need to remove $C(27),&amp;quot;&amp;amp;k2G&amp;quot; on Windows Servers):&lt;br /&gt;
&lt;br /&gt;
NB: CPI = Characters Per Inch; LPI = Lines Per Inch&lt;br /&gt;
=== PCL Subtypes ===&lt;br /&gt;
==== PCL5 Quick Reference ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*27,&amp;quot;E&amp;quot;/$C(27,69) - Reset&lt;br /&gt;
*27,&amp;quot;&amp;amp;l0O&amp;quot; - Portrait / *27,&amp;quot;&amp;amp;l1O&amp;quot; - Landscape&lt;br /&gt;
*27,&amp;quot;&amp;amp;l3E&amp;quot; - Top Margin is 3 lines&lt;br /&gt;
*27,&amp;quot;&amp;amp;a5L&amp;quot; - Left Margin is 5 columns&lt;br /&gt;
*27,&amp;quot;&amp;amp;k2G&amp;quot; - Line endings are LF. Default Line endings are CRLF (unless overridden in printer settings).&lt;br /&gt;
*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; - Primary &#039;(s&#039; font is fixed pitch, 12 cpi, upright (not italic), not bold, and is the Courier Font (#4099).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 12 CPI 6 LPI ====&lt;br /&gt;
This is THE MOST COMMON subtype to use. Most reports in VISTA print on this one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 56&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  Landscape Letter 14 CPI 6 LPI ====&lt;br /&gt;
This is the second most common subtype. Any menu option that says it needs 132 characters will need to use this subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132          RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 45&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p14h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 17 CPI 7 LPI (MARs and BCMA Med Log) ====&lt;br /&gt;
This is the (theoretically) third most commonly used subtype. It&#039;s only used for specific reports. It&#039;s also known as a condensed print subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128           RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;(s0p17h9v0s0b4099T&amp;quot;,*27,&lt;br /&gt;
&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Landscape Letter 22 CPI 12 LPI ====&lt;br /&gt;
This is the subtype that will take the most amount of text; it&#039;s ideal to print a lot of data from Fileman, for example. It&#039;s also known as the condensed landscape print subtype. It&#039;s not commonly used except by Fileman power users.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228         RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p22h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot;               W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Legal 12 CPI 6 LPI ====&lt;br /&gt;
This is not commonly used; I just created this because I thought it might come in useful for some users.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
NAME: P-HP-LGL-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 74&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Greensheet ====&lt;br /&gt;
If you don&#039;t know what a greensheet is, then skip this. It&#039;s here for those who want it. You need to buy a barcode chip for the barcodes to print.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-GREENSHEET      RIGHT MARGIN: 100&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l0O&amp;quot;,*27,&amp;quot;&amp;amp;l4H&amp;quot;,*27,&amp;quot;&amp;amp;l1E&amp;quot;,*27,&amp;quot;(s0p&amp;quot;&lt;br /&gt;
_$S($G(PSDCPI)=10:&amp;quot;10h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10H&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12H&amp;quot;&lt;br /&gt;
  DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
  DEFAULT LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l8C&amp;quot;&lt;br /&gt;
  X LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l12C&amp;quot;&lt;br /&gt;
  BAR CODE OFF: &amp;quot;*&amp;quot;_$C(27)_&amp;quot;&amp;amp;l0O&amp;quot;_$C(27)_&amp;quot;(8U&amp;quot;_$C(27)_&amp;quot;(s0p&amp;quot;_$S($G(PSDCPI)=10:&amp;quot;1&lt;br /&gt;
0h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot;&lt;br /&gt;
  BAR CODE ON: $S($D(PSDX2):$C(27)_&amp;quot;*p&amp;quot;_(PSDX2-1*300+200)_&amp;quot;y*p&amp;quot;_(PSDX1-1*810+38)&lt;br /&gt;
_&amp;quot;X&amp;quot;,1:&amp;quot;&amp;quot;)_$C(27)_&amp;quot;(0Y&amp;quot;_$C(27)_&amp;quot;(s0p8.1h12v0s0b0T*&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Outpatient Label Printer ====&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HPLJ4SI-P12                     SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 57                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;&lt;br /&gt;
 W $C(27),&amp;quot;&amp;amp;k2G&amp;quot; S $X=0                 DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: ACI&lt;br /&gt;
  FULL NAME: ADDRESS CHANGE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F12&amp;quot;,PSOX=1210,PSOY=700,PSOFY=1270&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: ALI&lt;br /&gt;
  FULL NAME: ALLERGY SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=1350,PSOYI=50,PSOYM=2700&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: AWI&lt;br /&gt;
  FULL NAME: ALLERGY WARNING INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: BLB&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BODY INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSODX=275,PSOY=140,PSOYI=40,PSOYM=379,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: BLBC&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(s1p10.4v4,12b4,12s24670T&amp;quot;,$C(27),&amp;quot;&amp;amp;a90P&amp;quot;,$C(27),&amp;quot;*p36&lt;br /&gt;
50x1000Y&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: BLF&lt;br /&gt;
  FULL NAME: BOTTLE LABEL FOOTER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSODY=460,PSOX=0,PSOCX=280,PSOQY=550,PSOTY=600,PSOFONT=&amp;quot;F10&amp;quot;,P&lt;br /&gt;
SOQFONT=&amp;quot;F8&amp;quot;,PSODFONT=&amp;quot;F9&amp;quot;,PSOTFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 7                               CTRL CODE ABBREVIATION: BLH&lt;br /&gt;
  FULL NAME: BOTTLE LABEL HEADER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=100,PSOY=50,PSOYI=30,PSOFONT=&amp;quot;F9&amp;quot;&lt;br /&gt;
NUMBER: 8                               CTRL CODE ABBREVIATION: CDII&lt;br /&gt;
  FULL NAME: CRITICAL DRUG INTERACTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 9                               CTRL CODE ABBREVIATION: CNI&lt;br /&gt;
  FULL NAME: COPAY NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOX=1210,PSOYM=3950,PSOFONT=&amp;quot;F10&amp;quot;,PSOYI=50&lt;br /&gt;
NUMBER: 10                              CTRL CODE ABBREVIATION: EBLBC&lt;br /&gt;
  FULL NAME: END OF BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;,$C(27),&amp;quot;&amp;amp;a0P&amp;quot;,!&lt;br /&gt;
NUMBER: 11                              CTRL CODE ABBREVIATION: EBT&lt;br /&gt;
  FULL NAME: END OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(8U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;,!&lt;br /&gt;
NUMBER: 12                              CTRL CODE ABBREVIATION: F10&lt;br /&gt;
  FULL NAME: TEN POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 13                              CTRL CODE ABBREVIATION: F10B&lt;br /&gt;
  FULL NAME: TEN POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 14                              CTRL CODE ABBREVIATION: F12&lt;br /&gt;
  FULL NAME: TWELVE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 15                              CTRL CODE ABBREVIATION: F12B&lt;br /&gt;
  FULL NAME: 12 POINT FONT BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 16                              CTRL CODE ABBREVIATION: F6&lt;br /&gt;
  FULL NAME: SIX POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 17                              CTRL CODE ABBREVIATION: F6B&lt;br /&gt;
  FULL NAME: SIX POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 18                              CTRL CODE ABBREVIATION: F8&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 19                              CTRL CODE ABBREVIATION: F8B&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 20                              CTRL CODE ABBREVIATION: F9&lt;br /&gt;
  FULL NAME: NINE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 21                              CTRL CODE ABBREVIATION: F9B&lt;br /&gt;
  FULL NAME: NINE POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 22                              CTRL CODE ABBREVIATION: FDU&lt;br /&gt;
  FULL NAME: FONT DISABLE UNDERLINE     CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d@&amp;quot;&lt;br /&gt;
NUMBER: 23                              CTRL CODE ABBREVIATION: FWU&lt;br /&gt;
  FULL NAME: FONT WITH UNDERLINE        CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d0D&amp;quot;&lt;br /&gt;
NUMBER: 24                              CTRL CODE ABBREVIATION: LL&lt;br /&gt;
  FULL NAME: LASER LABEL                CONTROL CODE: Q&lt;br /&gt;
NUMBER: 25                              CTRL CODE ABBREVIATION: LLI&lt;br /&gt;
  FULL NAME: LASER LABEL INIT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;&amp;amp;r1F&amp;quot;,$C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;u300D&amp;quot;,$C(27),&lt;br /&gt;
&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0E&amp;quot;,!&lt;br /&gt;
NUMBER: 26                              CTRL CODE ABBREVIATION: MLI&lt;br /&gt;
  FULL NAME: MAILING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=175,PSOYI=50&lt;br /&gt;
NUMBER: 27                              CTRL CODE ABBREVIATION: NR&lt;br /&gt;
  FULL NAME: NORMAL ROTATION            CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a0P&amp;quot;&lt;br /&gt;
NUMBER: 28                              CTRL CODE ABBREVIATION: PFDI&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=690,PSOYI=40,PSOYM=969&lt;br /&gt;
NUMBER: 29                              CTRL CODE ABBREVIATION: PFDQ&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT QUANTITY&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOCX=200,PSOY=970,PSOYI=50,PSOQFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 30                              CTRL CODE ABBREVIATION: PFDT&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT TRAILER&lt;br /&gt;
  CONTROL CODE: S PSOY=1015,PSOYI=45,PSOX=0,PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=50,PSOTFONT=&amp;quot;F9&lt;br /&gt;
&amp;quot;,PSOBY=1280&lt;br /&gt;
NUMBER: 31                              CTRL CODE ABBREVIATION: PFDW&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT WARNING&lt;br /&gt;
  CONTROL CODE: S PSOY=1258,PSOX=660,PSOYI=30,PSOFONT=&amp;quot;F8&amp;quot;,PSOYM=1329&lt;br /&gt;
NUMBER: 32                              CTRL CODE ABBREVIATION: PFI&lt;br /&gt;
  FULL NAME: PATIENT FILL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=710,PSOYI=45,PSOHFONT=&amp;quot;F12&amp;quot;,PSOBY&lt;br /&gt;
I=100&lt;br /&gt;
NUMBER: 33                              CTRL CODE ABBREVIATION: PII&lt;br /&gt;
  FULL NAME: PATIENT INSTRUCTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1210,PSOY=760,PSOFONT=&amp;quot;F12&amp;quot;&lt;br /&gt;
NUMBER: 34                              CTRL CODE ABBREVIATION: PMII&lt;br /&gt;
  FULL NAME: PMI SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1350,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;,PSOYM=3899&lt;br /&gt;
NUMBER: 35                              CTRL CODE ABBREVIATION: RMI&lt;br /&gt;
  FULL NAME: RETURN MAIL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=35,PSORYI=40,PSOHYI&lt;br /&gt;
=40,PSOTFONT=&amp;quot;F8&amp;quot;,PSOTY=550&lt;br /&gt;
NUMBER: 36                              CTRL CODE ABBREVIATION: RNI&lt;br /&gt;
  FULL NAME: REFILL NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOYI=50,PSOYM=3950&lt;br /&gt;
NUMBER: 37                              CTRL CODE ABBREVIATION: RPI&lt;br /&gt;
  FULL NAME: REFILL PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=65,PSOTYI=50,PSOLX=0,PSORX=1210,PSOY=1350&lt;br /&gt;
,PSOYM=3650,PSOXI=90,PSOSYI=135&lt;br /&gt;
NUMBER: 38                              CTRL CODE ABBREVIATION: RT&lt;br /&gt;
  FULL NAME: ROTATE TEXT                CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a90P&amp;quot;&lt;br /&gt;
NUMBER: 39                              CTRL CODE ABBREVIATION: SBT&lt;br /&gt;
  FULL NAME: START OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;,$C(27),&amp;quot;(s1p14&lt;br /&gt;
.4v6,18b6,18s24670T&amp;quot;&lt;br /&gt;
NUMBER: 40                              CTRL CODE ABBREVIATION: SPI&lt;br /&gt;
  FULL NAME: SUSPENSE PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=1350,PSOYI=50,PSOCX=1775,PSOYM=27&lt;br /&gt;
00&lt;br /&gt;
NUMBER: 41                              CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: START OF TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;&lt;br /&gt;
NUMBER: 42                              CTRL CODE ABBREVIATION: WLI&lt;br /&gt;
  FULL NAME: WARNING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1050,PSOY=55&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zebra Subtypes ===&lt;br /&gt;
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&#039;t use them.&lt;br /&gt;
&lt;br /&gt;
==== ZPL II Commands Cheat Sheet ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA - Start Label&lt;br /&gt;
^XZ - End Label&lt;br /&gt;
^LL - Label Length (Height)&lt;br /&gt;
^PW - Print Width&lt;br /&gt;
^CF - Set default Font&lt;br /&gt;
^LH - Label Home (Set a specific point to be the 0,0 coordinate for printing)&lt;br /&gt;
^A - Specify a font for the next ^FD (Field Definition). Resets to ^CF font after ^FD.&lt;br /&gt;
^CI - Change font encoding. 0 is USA-1, 28 is UTF-8, 30 is UTF-16 LE&lt;br /&gt;
^FR - Field Reverse Print; like reverse video for monitors&lt;br /&gt;
^FD - Field Data: contains what to print&lt;br /&gt;
^FS - Field Separator: End field data&lt;br /&gt;
^FB - Field Block: Allows you to print text with word wrapping&lt;br /&gt;
^BY - Bar Code Field Default: sets size of barcode.&lt;br /&gt;
^B3 - Code 39 barcode&lt;br /&gt;
^BC - Code 128 barcode&lt;br /&gt;
^BX - Datamatrix Barcode&lt;br /&gt;
^BQ - QR Barcode&lt;br /&gt;
^PH - Form Feed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Lab Label ====&lt;br /&gt;
This is 1&amp;quot; x 2&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-LAB&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW406.4^CFD,18,10^LH25,10&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W &amp;quot;^XZ&amp;quot;                DESCRIPTION: Zebra Lab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy BCMA Label ====&lt;br /&gt;
This is 1&amp;quot; x 3.5&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-BCMA                &lt;br /&gt;
  RIGHT MARGIN: 80                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 10                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: SL&lt;br /&gt;
  FULL NAME: Start Label                CONTROL CODE: W !,&amp;quot;^XA&amp;quot;,!,&amp;quot;^LH0,0^FS&amp;quot;&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: EL&lt;br /&gt;
  FULL NAME: End Label                  CONTROL CODE: W !,&amp;quot;^XZ&amp;quot;&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: EB&lt;br /&gt;
  FULL NAME: End Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO20,150^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: SB&lt;br /&gt;
  FULL NAME: Start Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^BY1,2.0^FO650,25^BXN,3,200^FD&amp;quot;_PSBBAR_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: Start Text&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO&amp;quot;_PSBTYPE_&amp;quot;^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: STF&lt;br /&gt;
  FULL NAME: Start Text Field&lt;br /&gt;
  CONTROL CODE: S PSBTYPE=$S(PSBTLE=&amp;quot;PSBDRUG&amp;quot;:&amp;quot;20,25&amp;quot;,PSBTLE=&amp;quot;PSBDOSE&amp;quot;:&amp;quot;20,60^FB&lt;br /&gt;
320,5&amp;quot;,PSBTLE=&amp;quot;PSBNAME&amp;quot;:&amp;quot;350,60&amp;quot;,PSBTLE=&amp;quot;PSBWARD&amp;quot;:&amp;quot;350,90&amp;quot;,PSBTLE=&amp;quot;PSBLOT&amp;quot;:&amp;quot;350,&lt;br /&gt;
120&amp;quot;,PSBTLE=&amp;quot;PSBEXP&amp;quot;:&amp;quot;350,150&amp;quot;,PSBTLE=&amp;quot;PSBMFG&amp;quot;:&amp;quot;500,150&amp;quot;,PSBTLE=&amp;quot;PSBFCB&amp;quot;:&amp;quot;350,18&lt;br /&gt;
0&amp;quot;,1:&amp;quot;0,0&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Unit Dose Label (vxVistA only) ====&lt;br /&gt;
VA VistA uses a dot matrix printer printing on a sheet of 1&amp;quot; x 3.5&amp;quot; x 2 columns.&lt;br /&gt;
vxVistA was written to use Unit Dose labels. This is 1&amp;quot; x 3.5&amp;quot; single column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-UD&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Support for Advanced Subtype Specifiers ==&lt;br /&gt;
If you look at [http://www.va.gov/vdl/documents/Infrastructure/Kernel/krn8_0sm.pdf|The 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.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LASER;P-LASER-LANDSCAPE;/M132L100P16BQ2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
How to set up a device to support this isn&#039;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10h&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
  HIGH INTENSITY (BOLD): $C(27)_&amp;quot;(s3b&amp;quot;  LOW INTENSITY (UNBOLD): $C(27)_&amp;quot;(s-3b&amp;quot;&lt;br /&gt;
  NORMAL INTENSITY (RESET): $C(27)_&amp;quot;(s0b&amp;quot;&lt;br /&gt;
  16 PITCH: $C(27)_&amp;quot;(s16h&amp;quot;              DEFAULT PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;t support &#039;Q&#039; in the configuration above, so it has no effect; that&#039;s because &#039;Q&#039; is nonsensical when using laser printers. It had a use back in the dot-matrix days.&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17206</id>
		<title>VISTA Printing Printer Subtypes</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17206"/>
		<updated>2016-10-24T23:13:57Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Support for Advanced Subtype Specifiers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= VISTA Subtypes =&lt;br /&gt;
&#039;&#039;Written by Sam Habiel&#039;&#039;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== What is a Subtype ==&lt;br /&gt;
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&#039;t used with printers; Form Feed goes into the M variable IOF, Page Length goes into the M variable IOSL (&amp;quot;IO Screen Length&amp;quot;) which determines how many lines are to be printed on each page before VISTA sends an IOF to go to the next page. That&#039;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&#039;t specify how many lines to print, so the former behavior will happen with them. The solution is to decrease page length.&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;s to make sure all reports relied on the device handler for printing separator pages, but that never happened.&lt;br /&gt;
&lt;br /&gt;
There is a field in the device file called &amp;quot;SUPPRESS FORM FEED AT CLOSE&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
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 &#039;#&#039;, it will have no effect on the Zebra printer.&lt;br /&gt;
&lt;br /&gt;
== How to Specify a Subtype? ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
However, you can override subtype selection on a job basis, by using this syntax on the Device prompt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE: printer_name;subtype&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you type a partial match, the device driver (^%ZIS) is going to list all partial matches for you to choose from. That&#039;s pretty nice, since I never remember what subtypes I have beyond them having P-HP at the beginning.&lt;br /&gt;
&lt;br /&gt;
There are variations on this syntax, by the way, that don&#039;t have to do with subtypes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. DEVICE: printer_name;right margin;page length&lt;br /&gt;
2. DEVICE: printer_name;subtype;right margin; page length&lt;br /&gt;
2. DEVICE: ;right margin;page length&lt;br /&gt;
3. DEVICE: ;;page length&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;t specified, the home device is assumed.&lt;br /&gt;
&lt;br /&gt;
Novice power users type &#039;;;99999&#039; 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&#039;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&#039;t remember having encountered that problem. It&#039;s possible there is something in ^%ZIS4 that I missed regarding that.&lt;br /&gt;
&lt;br /&gt;
== Common Subtypes in VISTA ==&lt;br /&gt;
Here are the most common subtypes in VISTA (standardized for Unices; you will need to remove $C(27),&amp;quot;&amp;amp;k2G&amp;quot; on Windows Servers):&lt;br /&gt;
&lt;br /&gt;
NB: CPI = Characters Per Inch; LPI = Lines Per Inch&lt;br /&gt;
=== PCL Subtypes ===&lt;br /&gt;
==== PCL5 Quick Reference ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*27,&amp;quot;E&amp;quot;/$C(27,69) - Reset&lt;br /&gt;
*27,&amp;quot;&amp;amp;l0O&amp;quot; - Portrait / *27,&amp;quot;&amp;amp;l1O&amp;quot; - Landscape&lt;br /&gt;
*27,&amp;quot;&amp;amp;l3E&amp;quot; - Top Margin is 3 lines&lt;br /&gt;
*27,&amp;quot;&amp;amp;a5L&amp;quot; - Left Margin is 5 columns&lt;br /&gt;
*27,&amp;quot;&amp;amp;k2G&amp;quot; - Line endings are LF. Default Line endings are CRLF (unless overridden in printer settings).&lt;br /&gt;
*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; - Primary &#039;(s&#039; font is fixed pitch, 12 cpi, upright (not italic), not bold, and is the Courier Font (#4099).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 12 CPI 6 LPI ====&lt;br /&gt;
This is THE MOST COMMON subtype to use. Most reports in VISTA print on this one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 56&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  Landscape Letter 14 CPI 6 LPI ====&lt;br /&gt;
This is the second most common subtype. Any menu option that says it needs 132 characters will need to use this subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132          RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 45&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p14h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 17 CPI 7 LPI (MARs and BCMA Med Log) ====&lt;br /&gt;
This is the (theoretically) third most commonly used subtype. It&#039;s only used for specific reports. It&#039;s also known as a condensed print subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128           RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;(s0p17h9v0s0b4099T&amp;quot;,*27,&lt;br /&gt;
&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Landscape Letter 22 CPI 12 LPI ====&lt;br /&gt;
This is the subtype that will take the most amount of text; it&#039;s ideal to print a lot of data from Fileman, for example. It&#039;s also known as the condensed landscape print subtype. It&#039;s not commonly used except by Fileman power users.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228         RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p22h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot;               W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Legal 12 CPI 6 LPI ====&lt;br /&gt;
This is not commonly used; I just created this because I thought it might come in useful for some users.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
NAME: P-HP-LGL-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 74&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Greensheet ====&lt;br /&gt;
If you don&#039;t know what a greensheet is, then skip this. It&#039;s here for those who want it. You need to buy a barcode chip for the barcodes to print.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-GREENSHEET      RIGHT MARGIN: 100&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l0O&amp;quot;,*27,&amp;quot;&amp;amp;l4H&amp;quot;,*27,&amp;quot;&amp;amp;l1E&amp;quot;,*27,&amp;quot;(s0p&amp;quot;&lt;br /&gt;
_$S($G(PSDCPI)=10:&amp;quot;10h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10H&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12H&amp;quot;&lt;br /&gt;
  DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
  DEFAULT LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l8C&amp;quot;&lt;br /&gt;
  X LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l12C&amp;quot;&lt;br /&gt;
  BAR CODE OFF: &amp;quot;*&amp;quot;_$C(27)_&amp;quot;&amp;amp;l0O&amp;quot;_$C(27)_&amp;quot;(8U&amp;quot;_$C(27)_&amp;quot;(s0p&amp;quot;_$S($G(PSDCPI)=10:&amp;quot;1&lt;br /&gt;
0h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot;&lt;br /&gt;
  BAR CODE ON: $S($D(PSDX2):$C(27)_&amp;quot;*p&amp;quot;_(PSDX2-1*300+200)_&amp;quot;y*p&amp;quot;_(PSDX1-1*810+38)&lt;br /&gt;
_&amp;quot;X&amp;quot;,1:&amp;quot;&amp;quot;)_$C(27)_&amp;quot;(0Y&amp;quot;_$C(27)_&amp;quot;(s0p8.1h12v0s0b0T*&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Outpatient Label Printer ====&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HPLJ4SI-P12                     SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 57                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;&lt;br /&gt;
 W $C(27),&amp;quot;&amp;amp;k2G&amp;quot; S $X=0                 DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: ACI&lt;br /&gt;
  FULL NAME: ADDRESS CHANGE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F12&amp;quot;,PSOX=1210,PSOY=700,PSOFY=1270&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: ALI&lt;br /&gt;
  FULL NAME: ALLERGY SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=1350,PSOYI=50,PSOYM=2700&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: AWI&lt;br /&gt;
  FULL NAME: ALLERGY WARNING INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: BLB&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BODY INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSODX=275,PSOY=140,PSOYI=40,PSOYM=379,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: BLBC&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(s1p10.4v4,12b4,12s24670T&amp;quot;,$C(27),&amp;quot;&amp;amp;a90P&amp;quot;,$C(27),&amp;quot;*p36&lt;br /&gt;
50x1000Y&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: BLF&lt;br /&gt;
  FULL NAME: BOTTLE LABEL FOOTER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSODY=460,PSOX=0,PSOCX=280,PSOQY=550,PSOTY=600,PSOFONT=&amp;quot;F10&amp;quot;,P&lt;br /&gt;
SOQFONT=&amp;quot;F8&amp;quot;,PSODFONT=&amp;quot;F9&amp;quot;,PSOTFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 7                               CTRL CODE ABBREVIATION: BLH&lt;br /&gt;
  FULL NAME: BOTTLE LABEL HEADER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=100,PSOY=50,PSOYI=30,PSOFONT=&amp;quot;F9&amp;quot;&lt;br /&gt;
NUMBER: 8                               CTRL CODE ABBREVIATION: CDII&lt;br /&gt;
  FULL NAME: CRITICAL DRUG INTERACTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 9                               CTRL CODE ABBREVIATION: CNI&lt;br /&gt;
  FULL NAME: COPAY NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOX=1210,PSOYM=3950,PSOFONT=&amp;quot;F10&amp;quot;,PSOYI=50&lt;br /&gt;
NUMBER: 10                              CTRL CODE ABBREVIATION: EBLBC&lt;br /&gt;
  FULL NAME: END OF BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;,$C(27),&amp;quot;&amp;amp;a0P&amp;quot;,!&lt;br /&gt;
NUMBER: 11                              CTRL CODE ABBREVIATION: EBT&lt;br /&gt;
  FULL NAME: END OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(8U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;,!&lt;br /&gt;
NUMBER: 12                              CTRL CODE ABBREVIATION: F10&lt;br /&gt;
  FULL NAME: TEN POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 13                              CTRL CODE ABBREVIATION: F10B&lt;br /&gt;
  FULL NAME: TEN POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 14                              CTRL CODE ABBREVIATION: F12&lt;br /&gt;
  FULL NAME: TWELVE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 15                              CTRL CODE ABBREVIATION: F12B&lt;br /&gt;
  FULL NAME: 12 POINT FONT BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 16                              CTRL CODE ABBREVIATION: F6&lt;br /&gt;
  FULL NAME: SIX POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 17                              CTRL CODE ABBREVIATION: F6B&lt;br /&gt;
  FULL NAME: SIX POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 18                              CTRL CODE ABBREVIATION: F8&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 19                              CTRL CODE ABBREVIATION: F8B&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 20                              CTRL CODE ABBREVIATION: F9&lt;br /&gt;
  FULL NAME: NINE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 21                              CTRL CODE ABBREVIATION: F9B&lt;br /&gt;
  FULL NAME: NINE POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 22                              CTRL CODE ABBREVIATION: FDU&lt;br /&gt;
  FULL NAME: FONT DISABLE UNDERLINE     CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d@&amp;quot;&lt;br /&gt;
NUMBER: 23                              CTRL CODE ABBREVIATION: FWU&lt;br /&gt;
  FULL NAME: FONT WITH UNDERLINE        CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d0D&amp;quot;&lt;br /&gt;
NUMBER: 24                              CTRL CODE ABBREVIATION: LL&lt;br /&gt;
  FULL NAME: LASER LABEL                CONTROL CODE: Q&lt;br /&gt;
NUMBER: 25                              CTRL CODE ABBREVIATION: LLI&lt;br /&gt;
  FULL NAME: LASER LABEL INIT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;&amp;amp;r1F&amp;quot;,$C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;u300D&amp;quot;,$C(27),&lt;br /&gt;
&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0E&amp;quot;,!&lt;br /&gt;
NUMBER: 26                              CTRL CODE ABBREVIATION: MLI&lt;br /&gt;
  FULL NAME: MAILING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=175,PSOYI=50&lt;br /&gt;
NUMBER: 27                              CTRL CODE ABBREVIATION: NR&lt;br /&gt;
  FULL NAME: NORMAL ROTATION            CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a0P&amp;quot;&lt;br /&gt;
NUMBER: 28                              CTRL CODE ABBREVIATION: PFDI&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=690,PSOYI=40,PSOYM=969&lt;br /&gt;
NUMBER: 29                              CTRL CODE ABBREVIATION: PFDQ&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT QUANTITY&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOCX=200,PSOY=970,PSOYI=50,PSOQFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 30                              CTRL CODE ABBREVIATION: PFDT&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT TRAILER&lt;br /&gt;
  CONTROL CODE: S PSOY=1015,PSOYI=45,PSOX=0,PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=50,PSOTFONT=&amp;quot;F9&lt;br /&gt;
&amp;quot;,PSOBY=1280&lt;br /&gt;
NUMBER: 31                              CTRL CODE ABBREVIATION: PFDW&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT WARNING&lt;br /&gt;
  CONTROL CODE: S PSOY=1258,PSOX=660,PSOYI=30,PSOFONT=&amp;quot;F8&amp;quot;,PSOYM=1329&lt;br /&gt;
NUMBER: 32                              CTRL CODE ABBREVIATION: PFI&lt;br /&gt;
  FULL NAME: PATIENT FILL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=710,PSOYI=45,PSOHFONT=&amp;quot;F12&amp;quot;,PSOBY&lt;br /&gt;
I=100&lt;br /&gt;
NUMBER: 33                              CTRL CODE ABBREVIATION: PII&lt;br /&gt;
  FULL NAME: PATIENT INSTRUCTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1210,PSOY=760,PSOFONT=&amp;quot;F12&amp;quot;&lt;br /&gt;
NUMBER: 34                              CTRL CODE ABBREVIATION: PMII&lt;br /&gt;
  FULL NAME: PMI SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1350,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;,PSOYM=3899&lt;br /&gt;
NUMBER: 35                              CTRL CODE ABBREVIATION: RMI&lt;br /&gt;
  FULL NAME: RETURN MAIL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=35,PSORYI=40,PSOHYI&lt;br /&gt;
=40,PSOTFONT=&amp;quot;F8&amp;quot;,PSOTY=550&lt;br /&gt;
NUMBER: 36                              CTRL CODE ABBREVIATION: RNI&lt;br /&gt;
  FULL NAME: REFILL NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOYI=50,PSOYM=3950&lt;br /&gt;
NUMBER: 37                              CTRL CODE ABBREVIATION: RPI&lt;br /&gt;
  FULL NAME: REFILL PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=65,PSOTYI=50,PSOLX=0,PSORX=1210,PSOY=1350&lt;br /&gt;
,PSOYM=3650,PSOXI=90,PSOSYI=135&lt;br /&gt;
NUMBER: 38                              CTRL CODE ABBREVIATION: RT&lt;br /&gt;
  FULL NAME: ROTATE TEXT                CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a90P&amp;quot;&lt;br /&gt;
NUMBER: 39                              CTRL CODE ABBREVIATION: SBT&lt;br /&gt;
  FULL NAME: START OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;,$C(27),&amp;quot;(s1p14&lt;br /&gt;
.4v6,18b6,18s24670T&amp;quot;&lt;br /&gt;
NUMBER: 40                              CTRL CODE ABBREVIATION: SPI&lt;br /&gt;
  FULL NAME: SUSPENSE PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=1350,PSOYI=50,PSOCX=1775,PSOYM=27&lt;br /&gt;
00&lt;br /&gt;
NUMBER: 41                              CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: START OF TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;&lt;br /&gt;
NUMBER: 42                              CTRL CODE ABBREVIATION: WLI&lt;br /&gt;
  FULL NAME: WARNING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1050,PSOY=55&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zebra Subtypes ===&lt;br /&gt;
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 shrunk. 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&#039;t use them.&lt;br /&gt;
&lt;br /&gt;
==== ZPL II Commands Cheat Sheet ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA - Start Label&lt;br /&gt;
^XZ - End Label&lt;br /&gt;
^LL - Label Length (Height)&lt;br /&gt;
^PW - Print Width&lt;br /&gt;
^CF - Set default Font&lt;br /&gt;
^LH - Label Home (Set a specific point to be the 0,0 coordinate for printing)&lt;br /&gt;
^A - Specify a font for the next ^FD (Field Definition). Resets to ^CF font after ^FD.&lt;br /&gt;
^CI - Change font encoding. 0 is USA-1, 28 is UTF-8, 30 is UTF-16 LE&lt;br /&gt;
^FR - Field Reverse Print; like reverse video for monitors&lt;br /&gt;
^FD - Field Data: contains what to print&lt;br /&gt;
^FS - Field Separator: End field data&lt;br /&gt;
^FB - Field Block: Allows you to print text with word wrapping&lt;br /&gt;
^BY - Bar Code Field Default: sets size of barcode.&lt;br /&gt;
^B3 - Code 39 barcode&lt;br /&gt;
^BC - Code 128 barcode&lt;br /&gt;
^BX - Datamatrix Barcode&lt;br /&gt;
^BQ - QR Barcode&lt;br /&gt;
^PH - Form Feed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Lab Label ====&lt;br /&gt;
This is 1&amp;quot; x 2&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-LAB&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW406.4^CFD,18,10^LH25,10&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W &amp;quot;^XZ&amp;quot;                DESCRIPTION: Zebra Lab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy BCMA Label ====&lt;br /&gt;
This is 1&amp;quot; x 3.5&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-BCMA                &lt;br /&gt;
  RIGHT MARGIN: 80                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 10                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: SL&lt;br /&gt;
  FULL NAME: Start Label                CONTROL CODE: W !,&amp;quot;^XA&amp;quot;,!,&amp;quot;^LH0,0^FS&amp;quot;&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: EL&lt;br /&gt;
  FULL NAME: End Label                  CONTROL CODE: W !,&amp;quot;^XZ&amp;quot;&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: EB&lt;br /&gt;
  FULL NAME: End Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO20,150^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: SB&lt;br /&gt;
  FULL NAME: Start Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^BY1,2.0^FO650,25^BXN,3,200^FD&amp;quot;_PSBBAR_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: Start Text&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO&amp;quot;_PSBTYPE_&amp;quot;^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: STF&lt;br /&gt;
  FULL NAME: Start Text Field&lt;br /&gt;
  CONTROL CODE: S PSBTYPE=$S(PSBTLE=&amp;quot;PSBDRUG&amp;quot;:&amp;quot;20,25&amp;quot;,PSBTLE=&amp;quot;PSBDOSE&amp;quot;:&amp;quot;20,60^FB&lt;br /&gt;
320,5&amp;quot;,PSBTLE=&amp;quot;PSBNAME&amp;quot;:&amp;quot;350,60&amp;quot;,PSBTLE=&amp;quot;PSBWARD&amp;quot;:&amp;quot;350,90&amp;quot;,PSBTLE=&amp;quot;PSBLOT&amp;quot;:&amp;quot;350,&lt;br /&gt;
120&amp;quot;,PSBTLE=&amp;quot;PSBEXP&amp;quot;:&amp;quot;350,150&amp;quot;,PSBTLE=&amp;quot;PSBMFG&amp;quot;:&amp;quot;500,150&amp;quot;,PSBTLE=&amp;quot;PSBFCB&amp;quot;:&amp;quot;350,18&lt;br /&gt;
0&amp;quot;,1:&amp;quot;0,0&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Unit Dose Label (vxVistA only) ====&lt;br /&gt;
VA VistA uses a dot matrix printer printing on a sheet of 1&amp;quot; x 3.5&amp;quot; x 2 columns.&lt;br /&gt;
vxVistA was written to use Unit Dose labels. This is 1&amp;quot; x 3.5&amp;quot; single column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-UD&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Support for Advanced Subtype Specifiers ==&lt;br /&gt;
If you look at [http://www.va.gov/vdl/documents/Infrastructure/Kernel/krn8_0sm.pdf|The 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.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LASER;P-LASER-LANDSCAPE;/M132L100P16BQ2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
How to set up a device to support this isn&#039;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10h&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
  HIGH INTENSITY (BOLD): $C(27)_&amp;quot;(s3b&amp;quot;  LOW INTENSITY (UNBOLD): $C(27)_&amp;quot;(s-3b&amp;quot;&lt;br /&gt;
  NORMAL INTENSITY (RESET): $C(27)_&amp;quot;(s0b&amp;quot;&lt;br /&gt;
  16 PITCH: $C(27)_&amp;quot;(s16h&amp;quot;              DEFAULT PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;t support &#039;Q&#039; in the configuration above, so it has no effect; that&#039;s because &#039;Q&#039; is nonsensical when using laser printers. It had a use back in the dot-matrix days.&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17205</id>
		<title>VISTA Printing Printer Subtypes</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17205"/>
		<updated>2016-10-24T23:12:38Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* VISTA Subtypes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= VISTA Subtypes =&lt;br /&gt;
&#039;&#039;Written by Sam Habiel&#039;&#039;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== What is a Subtype ==&lt;br /&gt;
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&#039;t used with printers; Form Feed goes into the M variable IOF, Page Length goes into the M variable IOSL (&amp;quot;IO Screen Length&amp;quot;) which determines how many lines are to be printed on each page before VISTA sends an IOF to go to the next page. That&#039;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&#039;t specify how many lines to print, so the former behavior will happen with them. The solution is to decrease page length.&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;s to make sure all reports relied on the device handler for printing separator pages, but that never happened.&lt;br /&gt;
&lt;br /&gt;
There is a field in the device file called &amp;quot;SUPPRESS FORM FEED AT CLOSE&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
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 &#039;#&#039;, it will have no effect on the Zebra printer.&lt;br /&gt;
&lt;br /&gt;
== How to Specify a Subtype? ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
However, you can override subtype selection on a job basis, by using this syntax on the Device prompt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE: printer_name;subtype&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you type a partial match, the device driver (^%ZIS) is going to list all partial matches for you to choose from. That&#039;s pretty nice, since I never remember what subtypes I have beyond them having P-HP at the beginning.&lt;br /&gt;
&lt;br /&gt;
There are variations on this syntax, by the way, that don&#039;t have to do with subtypes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. DEVICE: printer_name;right margin;page length&lt;br /&gt;
2. DEVICE: printer_name;subtype;right margin; page length&lt;br /&gt;
2. DEVICE: ;right margin;page length&lt;br /&gt;
3. DEVICE: ;;page length&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;t specified, the home device is assumed.&lt;br /&gt;
&lt;br /&gt;
Novice power users type &#039;;;99999&#039; 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&#039;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&#039;t remember having encountered that problem. It&#039;s possible there is something in ^%ZIS4 that I missed regarding that.&lt;br /&gt;
&lt;br /&gt;
== Common Subtypes in VISTA ==&lt;br /&gt;
Here are the most common subtypes in VISTA (standardized for Unices; you will need to remove $C(27),&amp;quot;&amp;amp;k2G&amp;quot; on Windows Servers):&lt;br /&gt;
&lt;br /&gt;
NB: CPI = Characters Per Inch; LPI = Lines Per Inch&lt;br /&gt;
=== PCL Subtypes ===&lt;br /&gt;
==== PCL5 Quick Reference ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*27,&amp;quot;E&amp;quot;/$C(27,69) - Reset&lt;br /&gt;
*27,&amp;quot;&amp;amp;l0O&amp;quot; - Portrait / *27,&amp;quot;&amp;amp;l1O&amp;quot; - Landscape&lt;br /&gt;
*27,&amp;quot;&amp;amp;l3E&amp;quot; - Top Margin is 3 lines&lt;br /&gt;
*27,&amp;quot;&amp;amp;a5L&amp;quot; - Left Margin is 5 columns&lt;br /&gt;
*27,&amp;quot;&amp;amp;k2G&amp;quot; - Line endings are LF. Default Line endings are CRLF (unless overridden in printer settings).&lt;br /&gt;
*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; - Primary &#039;(s&#039; font is fixed pitch, 12 cpi, upright (not italic), not bold, and is the Courier Font (#4099).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 12 CPI 6 LPI ====&lt;br /&gt;
This is THE MOST COMMON subtype to use. Most reports in VISTA print on this one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 56&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  Landscape Letter 14 CPI 6 LPI ====&lt;br /&gt;
This is the second most common subtype. Any menu option that says it needs 132 characters will need to use this subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132          RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 45&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p14h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 17 CPI 7 LPI (MARs and BCMA Med Log) ====&lt;br /&gt;
This is the (theoretically) third most commonly used subtype. It&#039;s only used for specific reports. It&#039;s also known as a condensed print subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128           RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;(s0p17h9v0s0b4099T&amp;quot;,*27,&lt;br /&gt;
&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Landscape Letter 22 CPI 12 LPI ====&lt;br /&gt;
This is the subtype that will take the most amount of text; it&#039;s ideal to print a lot of data from Fileman, for example. It&#039;s also known as the condensed landscape print subtype. It&#039;s not commonly used except by Fileman power users.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228         RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p22h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot;               W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Legal 12 CPI 6 LPI ====&lt;br /&gt;
This is not commonly used; I just created this because I thought it might come in useful for some users.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
NAME: P-HP-LGL-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 74&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Greensheet ====&lt;br /&gt;
If you don&#039;t know what a greensheet is, then skip this. It&#039;s here for those who want it. You need to buy a barcode chip for the barcodes to print.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-GREENSHEET      RIGHT MARGIN: 100&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l0O&amp;quot;,*27,&amp;quot;&amp;amp;l4H&amp;quot;,*27,&amp;quot;&amp;amp;l1E&amp;quot;,*27,&amp;quot;(s0p&amp;quot;&lt;br /&gt;
_$S($G(PSDCPI)=10:&amp;quot;10h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10H&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12H&amp;quot;&lt;br /&gt;
  DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
  DEFAULT LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l8C&amp;quot;&lt;br /&gt;
  X LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l12C&amp;quot;&lt;br /&gt;
  BAR CODE OFF: &amp;quot;*&amp;quot;_$C(27)_&amp;quot;&amp;amp;l0O&amp;quot;_$C(27)_&amp;quot;(8U&amp;quot;_$C(27)_&amp;quot;(s0p&amp;quot;_$S($G(PSDCPI)=10:&amp;quot;1&lt;br /&gt;
0h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot;&lt;br /&gt;
  BAR CODE ON: $S($D(PSDX2):$C(27)_&amp;quot;*p&amp;quot;_(PSDX2-1*300+200)_&amp;quot;y*p&amp;quot;_(PSDX1-1*810+38)&lt;br /&gt;
_&amp;quot;X&amp;quot;,1:&amp;quot;&amp;quot;)_$C(27)_&amp;quot;(0Y&amp;quot;_$C(27)_&amp;quot;(s0p8.1h12v0s0b0T*&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Outpatient Label Printer ====&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HPLJ4SI-P12                     SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 57                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;&lt;br /&gt;
 W $C(27),&amp;quot;&amp;amp;k2G&amp;quot; S $X=0                 DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: ACI&lt;br /&gt;
  FULL NAME: ADDRESS CHANGE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F12&amp;quot;,PSOX=1210,PSOY=700,PSOFY=1270&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: ALI&lt;br /&gt;
  FULL NAME: ALLERGY SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=1350,PSOYI=50,PSOYM=2700&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: AWI&lt;br /&gt;
  FULL NAME: ALLERGY WARNING INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: BLB&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BODY INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSODX=275,PSOY=140,PSOYI=40,PSOYM=379,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: BLBC&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(s1p10.4v4,12b4,12s24670T&amp;quot;,$C(27),&amp;quot;&amp;amp;a90P&amp;quot;,$C(27),&amp;quot;*p36&lt;br /&gt;
50x1000Y&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: BLF&lt;br /&gt;
  FULL NAME: BOTTLE LABEL FOOTER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSODY=460,PSOX=0,PSOCX=280,PSOQY=550,PSOTY=600,PSOFONT=&amp;quot;F10&amp;quot;,P&lt;br /&gt;
SOQFONT=&amp;quot;F8&amp;quot;,PSODFONT=&amp;quot;F9&amp;quot;,PSOTFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 7                               CTRL CODE ABBREVIATION: BLH&lt;br /&gt;
  FULL NAME: BOTTLE LABEL HEADER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=100,PSOY=50,PSOYI=30,PSOFONT=&amp;quot;F9&amp;quot;&lt;br /&gt;
NUMBER: 8                               CTRL CODE ABBREVIATION: CDII&lt;br /&gt;
  FULL NAME: CRITICAL DRUG INTERACTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 9                               CTRL CODE ABBREVIATION: CNI&lt;br /&gt;
  FULL NAME: COPAY NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOX=1210,PSOYM=3950,PSOFONT=&amp;quot;F10&amp;quot;,PSOYI=50&lt;br /&gt;
NUMBER: 10                              CTRL CODE ABBREVIATION: EBLBC&lt;br /&gt;
  FULL NAME: END OF BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;,$C(27),&amp;quot;&amp;amp;a0P&amp;quot;,!&lt;br /&gt;
NUMBER: 11                              CTRL CODE ABBREVIATION: EBT&lt;br /&gt;
  FULL NAME: END OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(8U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;,!&lt;br /&gt;
NUMBER: 12                              CTRL CODE ABBREVIATION: F10&lt;br /&gt;
  FULL NAME: TEN POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 13                              CTRL CODE ABBREVIATION: F10B&lt;br /&gt;
  FULL NAME: TEN POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 14                              CTRL CODE ABBREVIATION: F12&lt;br /&gt;
  FULL NAME: TWELVE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 15                              CTRL CODE ABBREVIATION: F12B&lt;br /&gt;
  FULL NAME: 12 POINT FONT BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 16                              CTRL CODE ABBREVIATION: F6&lt;br /&gt;
  FULL NAME: SIX POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 17                              CTRL CODE ABBREVIATION: F6B&lt;br /&gt;
  FULL NAME: SIX POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 18                              CTRL CODE ABBREVIATION: F8&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 19                              CTRL CODE ABBREVIATION: F8B&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 20                              CTRL CODE ABBREVIATION: F9&lt;br /&gt;
  FULL NAME: NINE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 21                              CTRL CODE ABBREVIATION: F9B&lt;br /&gt;
  FULL NAME: NINE POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 22                              CTRL CODE ABBREVIATION: FDU&lt;br /&gt;
  FULL NAME: FONT DISABLE UNDERLINE     CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d@&amp;quot;&lt;br /&gt;
NUMBER: 23                              CTRL CODE ABBREVIATION: FWU&lt;br /&gt;
  FULL NAME: FONT WITH UNDERLINE        CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d0D&amp;quot;&lt;br /&gt;
NUMBER: 24                              CTRL CODE ABBREVIATION: LL&lt;br /&gt;
  FULL NAME: LASER LABEL                CONTROL CODE: Q&lt;br /&gt;
NUMBER: 25                              CTRL CODE ABBREVIATION: LLI&lt;br /&gt;
  FULL NAME: LASER LABEL INIT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;&amp;amp;r1F&amp;quot;,$C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;u300D&amp;quot;,$C(27),&lt;br /&gt;
&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0E&amp;quot;,!&lt;br /&gt;
NUMBER: 26                              CTRL CODE ABBREVIATION: MLI&lt;br /&gt;
  FULL NAME: MAILING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=175,PSOYI=50&lt;br /&gt;
NUMBER: 27                              CTRL CODE ABBREVIATION: NR&lt;br /&gt;
  FULL NAME: NORMAL ROTATION            CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a0P&amp;quot;&lt;br /&gt;
NUMBER: 28                              CTRL CODE ABBREVIATION: PFDI&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=690,PSOYI=40,PSOYM=969&lt;br /&gt;
NUMBER: 29                              CTRL CODE ABBREVIATION: PFDQ&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT QUANTITY&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOCX=200,PSOY=970,PSOYI=50,PSOQFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 30                              CTRL CODE ABBREVIATION: PFDT&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT TRAILER&lt;br /&gt;
  CONTROL CODE: S PSOY=1015,PSOYI=45,PSOX=0,PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=50,PSOTFONT=&amp;quot;F9&lt;br /&gt;
&amp;quot;,PSOBY=1280&lt;br /&gt;
NUMBER: 31                              CTRL CODE ABBREVIATION: PFDW&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT WARNING&lt;br /&gt;
  CONTROL CODE: S PSOY=1258,PSOX=660,PSOYI=30,PSOFONT=&amp;quot;F8&amp;quot;,PSOYM=1329&lt;br /&gt;
NUMBER: 32                              CTRL CODE ABBREVIATION: PFI&lt;br /&gt;
  FULL NAME: PATIENT FILL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=710,PSOYI=45,PSOHFONT=&amp;quot;F12&amp;quot;,PSOBY&lt;br /&gt;
I=100&lt;br /&gt;
NUMBER: 33                              CTRL CODE ABBREVIATION: PII&lt;br /&gt;
  FULL NAME: PATIENT INSTRUCTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1210,PSOY=760,PSOFONT=&amp;quot;F12&amp;quot;&lt;br /&gt;
NUMBER: 34                              CTRL CODE ABBREVIATION: PMII&lt;br /&gt;
  FULL NAME: PMI SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1350,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;,PSOYM=3899&lt;br /&gt;
NUMBER: 35                              CTRL CODE ABBREVIATION: RMI&lt;br /&gt;
  FULL NAME: RETURN MAIL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=35,PSORYI=40,PSOHYI&lt;br /&gt;
=40,PSOTFONT=&amp;quot;F8&amp;quot;,PSOTY=550&lt;br /&gt;
NUMBER: 36                              CTRL CODE ABBREVIATION: RNI&lt;br /&gt;
  FULL NAME: REFILL NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOYI=50,PSOYM=3950&lt;br /&gt;
NUMBER: 37                              CTRL CODE ABBREVIATION: RPI&lt;br /&gt;
  FULL NAME: REFILL PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=65,PSOTYI=50,PSOLX=0,PSORX=1210,PSOY=1350&lt;br /&gt;
,PSOYM=3650,PSOXI=90,PSOSYI=135&lt;br /&gt;
NUMBER: 38                              CTRL CODE ABBREVIATION: RT&lt;br /&gt;
  FULL NAME: ROTATE TEXT                CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a90P&amp;quot;&lt;br /&gt;
NUMBER: 39                              CTRL CODE ABBREVIATION: SBT&lt;br /&gt;
  FULL NAME: START OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;,$C(27),&amp;quot;(s1p14&lt;br /&gt;
.4v6,18b6,18s24670T&amp;quot;&lt;br /&gt;
NUMBER: 40                              CTRL CODE ABBREVIATION: SPI&lt;br /&gt;
  FULL NAME: SUSPENSE PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=1350,PSOYI=50,PSOCX=1775,PSOYM=27&lt;br /&gt;
00&lt;br /&gt;
NUMBER: 41                              CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: START OF TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;&lt;br /&gt;
NUMBER: 42                              CTRL CODE ABBREVIATION: WLI&lt;br /&gt;
  FULL NAME: WARNING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1050,PSOY=55&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zebra Subtypes ===&lt;br /&gt;
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 shrunk. 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&#039;t use them.&lt;br /&gt;
&lt;br /&gt;
==== ZPL II Commands Cheat Sheet ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA - Start Label&lt;br /&gt;
^XZ - End Label&lt;br /&gt;
^LL - Label Length (Height)&lt;br /&gt;
^PW - Print Width&lt;br /&gt;
^CF - Set default Font&lt;br /&gt;
^LH - Label Home (Set a specific point to be the 0,0 coordinate for printing)&lt;br /&gt;
^A - Specify a font for the next ^FD (Field Definition). Resets to ^CF font after ^FD.&lt;br /&gt;
^CI - Change font encoding. 0 is USA-1, 28 is UTF-8, 30 is UTF-16 LE&lt;br /&gt;
^FR - Field Reverse Print; like reverse video for monitors&lt;br /&gt;
^FD - Field Data: contains what to print&lt;br /&gt;
^FS - Field Separator: End field data&lt;br /&gt;
^FB - Field Block: Allows you to print text with word wrapping&lt;br /&gt;
^BY - Bar Code Field Default: sets size of barcode.&lt;br /&gt;
^B3 - Code 39 barcode&lt;br /&gt;
^BC - Code 128 barcode&lt;br /&gt;
^BX - Datamatrix Barcode&lt;br /&gt;
^BQ - QR Barcode&lt;br /&gt;
^PH - Form Feed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Lab Label ====&lt;br /&gt;
This is 1&amp;quot; x 2&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-LAB&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW406.4^CFD,18,10^LH25,10&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W &amp;quot;^XZ&amp;quot;                DESCRIPTION: Zebra Lab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy BCMA Label ====&lt;br /&gt;
This is 1&amp;quot; x 3.5&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-BCMA                &lt;br /&gt;
  RIGHT MARGIN: 80                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 10                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: SL&lt;br /&gt;
  FULL NAME: Start Label                CONTROL CODE: W !,&amp;quot;^XA&amp;quot;,!,&amp;quot;^LH0,0^FS&amp;quot;&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: EL&lt;br /&gt;
  FULL NAME: End Label                  CONTROL CODE: W !,&amp;quot;^XZ&amp;quot;&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: EB&lt;br /&gt;
  FULL NAME: End Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO20,150^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: SB&lt;br /&gt;
  FULL NAME: Start Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^BY1,2.0^FO650,25^BXN,3,200^FD&amp;quot;_PSBBAR_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: Start Text&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO&amp;quot;_PSBTYPE_&amp;quot;^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: STF&lt;br /&gt;
  FULL NAME: Start Text Field&lt;br /&gt;
  CONTROL CODE: S PSBTYPE=$S(PSBTLE=&amp;quot;PSBDRUG&amp;quot;:&amp;quot;20,25&amp;quot;,PSBTLE=&amp;quot;PSBDOSE&amp;quot;:&amp;quot;20,60^FB&lt;br /&gt;
320,5&amp;quot;,PSBTLE=&amp;quot;PSBNAME&amp;quot;:&amp;quot;350,60&amp;quot;,PSBTLE=&amp;quot;PSBWARD&amp;quot;:&amp;quot;350,90&amp;quot;,PSBTLE=&amp;quot;PSBLOT&amp;quot;:&amp;quot;350,&lt;br /&gt;
120&amp;quot;,PSBTLE=&amp;quot;PSBEXP&amp;quot;:&amp;quot;350,150&amp;quot;,PSBTLE=&amp;quot;PSBMFG&amp;quot;:&amp;quot;500,150&amp;quot;,PSBTLE=&amp;quot;PSBFCB&amp;quot;:&amp;quot;350,18&lt;br /&gt;
0&amp;quot;,1:&amp;quot;0,0&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Unit Dose Label (vxVistA only) ====&lt;br /&gt;
VA VistA uses a dot matrix printer printing on a sheet of 1&amp;quot; x 3.5&amp;quot; x 2 columns.&lt;br /&gt;
vxVistA was written to use Unit Dose labels. This is 1&amp;quot; x 3.5&amp;quot; single column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-UD&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Support for Advanced Subtype Specifiers ==&lt;br /&gt;
If you look at [http://www.va.gov/vdl/documents/Infrastructure/Kernel/krn8_0sm.pdf|the 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.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LASER;P-LASER-LANDSCAPE;/M132L100P16BQ2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
How to set up a device to support this isn&#039;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10h&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
  HIGH INTENSITY (BOLD): $C(27)_&amp;quot;(s3b&amp;quot;  LOW INTENSITY (UNBOLD): $C(27)_&amp;quot;(s-3b&amp;quot;&lt;br /&gt;
  NORMAL INTENSITY (RESET): $C(27)_&amp;quot;(s0b&amp;quot;&lt;br /&gt;
  16 PITCH: $C(27)_&amp;quot;(s16h&amp;quot;              DEFAULT PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;t support &#039;Q&#039; in the configuration above, so it has no effect; that&#039;s because &#039;Q&#039; is nonsensical when using laser printers. It had a use back in the dot-matrix days.&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17204</id>
		<title>VISTA Printing Printer Subtypes</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Printing_Printer_Subtypes&amp;diff=17204"/>
		<updated>2016-10-24T23:11:20Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* VISTA Subtypes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= VISTA Subtypes =&lt;br /&gt;
&#039;&#039;Written by Sam Habiel&#039;&#039;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== What is a Subtype ==&lt;br /&gt;
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&#039;t used with printers; Form Feed goes into the M variable IOF, Page Length goes into the M variable IOSL (&amp;quot;IO Screen Length&amp;quot;) which determines how many lines are to be printed on each page before VISTA sends an IOF to go to the next page. That&#039;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&#039;t specify how many lines to print, so the former behavior will happen with them. The solution is to decrease page length.&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;s to make sure all reports relied on the device handler for printing separator pages, but that never happened.&lt;br /&gt;
&lt;br /&gt;
There is a field in the device file called &amp;quot;SUPPRESS FORM FEED AT CLOSE&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
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 &#039;#&#039;, it will have no effect on the Zebra printer.&lt;br /&gt;
&lt;br /&gt;
== How to specify a Subtype? ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
However, you can override subtype selection on a job basis, by using this syntax on the Device prompt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE: printer_name;subtype&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you type a partial match, the device driver (^%ZIS) is going to list all partial matches for you to choose from. That&#039;s pretty nice, since I never remember what subtypes I have beyond them having P-HP at the beginning.&lt;br /&gt;
&lt;br /&gt;
There are variations on this syntax, by the way, that don&#039;t have to do with subtypes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. DEVICE: printer_name;right margin;page length&lt;br /&gt;
2. DEVICE: printer_name;subtype;right margin; page length&lt;br /&gt;
2. DEVICE: ;right margin;page length&lt;br /&gt;
3. DEVICE: ;;page length&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;t specified, the home device is assumed.&lt;br /&gt;
&lt;br /&gt;
Novice power users type &#039;;;99999&#039; 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&#039;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&#039;t remember having encountered that problem. It&#039;s possible there is something in ^%ZIS4 that I missed regarding that.&lt;br /&gt;
&lt;br /&gt;
== Common Subtypes in VISTA ==&lt;br /&gt;
Here are the most common subtypes in VISTA (standardized for Unices; you will need to remove $C(27),&amp;quot;&amp;amp;k2G&amp;quot; on Windows Servers):&lt;br /&gt;
&lt;br /&gt;
NB: CPI = Characters Per Inch; LPI = Lines Per Inch&lt;br /&gt;
=== PCL Subtypes ===&lt;br /&gt;
==== PCL5 Quick Reference ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*27,&amp;quot;E&amp;quot;/$C(27,69) - Reset&lt;br /&gt;
*27,&amp;quot;&amp;amp;l0O&amp;quot; - Portrait / *27,&amp;quot;&amp;amp;l1O&amp;quot; - Landscape&lt;br /&gt;
*27,&amp;quot;&amp;amp;l3E&amp;quot; - Top Margin is 3 lines&lt;br /&gt;
*27,&amp;quot;&amp;amp;a5L&amp;quot; - Left Margin is 5 columns&lt;br /&gt;
*27,&amp;quot;&amp;amp;k2G&amp;quot; - Line endings are LF. Default Line endings are CRLF (unless overridden in printer settings).&lt;br /&gt;
*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; - Primary &#039;(s&#039; font is fixed pitch, 12 cpi, upright (not italic), not bold, and is the Courier Font (#4099).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 12 CPI 6 LPI ====&lt;br /&gt;
This is THE MOST COMMON subtype to use. Most reports in VISTA print on this one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 56&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  Landscape Letter 14 CPI 6 LPI ====&lt;br /&gt;
This is the second most common subtype. Any menu option that says it needs 132 characters will need to use this subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132          RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 45&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p14h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Letter 17 CPI 7 LPI (MARs and BCMA Med Log) ====&lt;br /&gt;
This is the (theoretically) third most commonly used subtype. It&#039;s only used for specific reports. It&#039;s also known as a condensed print subtype.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128           RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;(s0p17h9v0s0b4099T&amp;quot;,*27,&lt;br /&gt;
&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Landscape Letter 22 CPI 12 LPI ====&lt;br /&gt;
This is the subtype that will take the most amount of text; it&#039;s ideal to print a lot of data from Fileman, for example. It&#039;s also known as the condensed landscape print subtype. It&#039;s not commonly used except by Fileman power users.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228         RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,*27,&amp;quot;(s0p22h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot;               W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Portrait Legal 12 CPI 6 LPI ====&lt;br /&gt;
This is not commonly used; I just created this because I thought it might come in useful for some users.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
NAME: P-HP-LGL-POR-C12L6-W80           RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 74&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;&amp;amp;&lt;br /&gt;
a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;(s0p12h0s0b4099T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W *27,&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Greensheet ====&lt;br /&gt;
If you don&#039;t know what a greensheet is, then skip this. It&#039;s here for those who want it. You need to buy a barcode chip for the barcodes to print.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-GREENSHEET      RIGHT MARGIN: 100&lt;br /&gt;
  FORM FEED: #                          PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l0O&amp;quot;,*27,&amp;quot;&amp;amp;l4H&amp;quot;,*27,&amp;quot;&amp;amp;l1E&amp;quot;,*27,&amp;quot;(s0p&amp;quot;&lt;br /&gt;
_$S($G(PSDCPI)=10:&amp;quot;10h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10H&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12H&amp;quot;&lt;br /&gt;
  DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
  DEFAULT LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l8C&amp;quot;&lt;br /&gt;
  X LINES PER INCH: $C(27)_&amp;quot;&amp;amp;l12C&amp;quot;&lt;br /&gt;
  BAR CODE OFF: &amp;quot;*&amp;quot;_$C(27)_&amp;quot;&amp;amp;l0O&amp;quot;_$C(27)_&amp;quot;(8U&amp;quot;_$C(27)_&amp;quot;(s0p&amp;quot;_$S($G(PSDCPI)=10:&amp;quot;1&lt;br /&gt;
0h14&amp;quot;,1:&amp;quot;12h12&amp;quot;)_&amp;quot;v0s0b6T&amp;quot;&lt;br /&gt;
  BAR CODE ON: $S($D(PSDX2):$C(27)_&amp;quot;*p&amp;quot;_(PSDX2-1*300+200)_&amp;quot;y*p&amp;quot;_(PSDX1-1*810+38)&lt;br /&gt;
_&amp;quot;X&amp;quot;,1:&amp;quot;&amp;quot;)_$C(27)_&amp;quot;(0Y&amp;quot;_$C(27)_&amp;quot;(s0p8.1h12v0s0b0T*&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Outpatient Label Printer ====&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HPLJ4SI-P12                     SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 57                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;&lt;br /&gt;
 W $C(27),&amp;quot;&amp;amp;k2G&amp;quot; S $X=0                 DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: ACI&lt;br /&gt;
  FULL NAME: ADDRESS CHANGE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F12&amp;quot;,PSOX=1210,PSOY=700,PSOFY=1270&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: ALI&lt;br /&gt;
  FULL NAME: ALLERGY SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=1350,PSOYI=50,PSOYM=2700&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: AWI&lt;br /&gt;
  FULL NAME: ALLERGY WARNING INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: BLB&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BODY INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSODX=275,PSOY=140,PSOYI=40,PSOYM=379,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: BLBC&lt;br /&gt;
  FULL NAME: BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(s1p10.4v4,12b4,12s24670T&amp;quot;,$C(27),&amp;quot;&amp;amp;a90P&amp;quot;,$C(27),&amp;quot;*p36&lt;br /&gt;
50x1000Y&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: BLF&lt;br /&gt;
  FULL NAME: BOTTLE LABEL FOOTER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSODY=460,PSOX=0,PSOCX=280,PSOQY=550,PSOTY=600,PSOFONT=&amp;quot;F10&amp;quot;,P&lt;br /&gt;
SOQFONT=&amp;quot;F8&amp;quot;,PSODFONT=&amp;quot;F9&amp;quot;,PSOTFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 7                               CTRL CODE ABBREVIATION: BLH&lt;br /&gt;
  FULL NAME: BOTTLE LABEL HEADER INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=100,PSOY=50,PSOYI=30,PSOFONT=&amp;quot;F9&amp;quot;&lt;br /&gt;
NUMBER: 8                               CTRL CODE ABBREVIATION: CDII&lt;br /&gt;
  FULL NAME: CRITICAL DRUG INTERACTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1400,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 9                               CTRL CODE ABBREVIATION: CNI&lt;br /&gt;
  FULL NAME: COPAY NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOX=1210,PSOYM=3950,PSOFONT=&amp;quot;F10&amp;quot;,PSOYI=50&lt;br /&gt;
NUMBER: 10                              CTRL CODE ABBREVIATION: EBLBC&lt;br /&gt;
  FULL NAME: END OF BOTTLE LABEL BARCODE&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;,$C(27),&amp;quot;&amp;amp;a0P&amp;quot;,!&lt;br /&gt;
NUMBER: 11                              CTRL CODE ABBREVIATION: EBT&lt;br /&gt;
  FULL NAME: END OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(8U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;,!&lt;br /&gt;
NUMBER: 12                              CTRL CODE ABBREVIATION: F10&lt;br /&gt;
  FULL NAME: TEN POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 13                              CTRL CODE ABBREVIATION: F10B&lt;br /&gt;
  FULL NAME: TEN POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p10v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 14                              CTRL CODE ABBREVIATION: F12&lt;br /&gt;
  FULL NAME: TWELVE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 15                              CTRL CODE ABBREVIATION: F12B&lt;br /&gt;
  FULL NAME: 12 POINT FONT BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p12v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 16                              CTRL CODE ABBREVIATION: F6&lt;br /&gt;
  FULL NAME: SIX POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 17                              CTRL CODE ABBREVIATION: F6B&lt;br /&gt;
  FULL NAME: SIX POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p6v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 18                              CTRL CODE ABBREVIATION: F8&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 19                              CTRL CODE ABBREVIATION: F8B&lt;br /&gt;
  FULL NAME: EIGHT POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p8v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 20                              CTRL CODE ABBREVIATION: F9&lt;br /&gt;
  FULL NAME: NINE POINT FONT - NO BOLD&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s0b16602T&amp;quot;&lt;br /&gt;
NUMBER: 21                              CTRL CODE ABBREVIATION: F9B&lt;br /&gt;
  FULL NAME: NINE POINT FONT, BOLDED&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;(10U&amp;quot;,$C(27),&amp;quot;(s1p9v0s3b16602T&amp;quot;&lt;br /&gt;
NUMBER: 22                              CTRL CODE ABBREVIATION: FDU&lt;br /&gt;
  FULL NAME: FONT DISABLE UNDERLINE     CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d@&amp;quot;&lt;br /&gt;
NUMBER: 23                              CTRL CODE ABBREVIATION: FWU&lt;br /&gt;
  FULL NAME: FONT WITH UNDERLINE        CONTROL CODE: W $C(27),&amp;quot;&amp;amp;d0D&amp;quot;&lt;br /&gt;
NUMBER: 24                              CTRL CODE ABBREVIATION: LL&lt;br /&gt;
  FULL NAME: LASER LABEL                CONTROL CODE: Q&lt;br /&gt;
NUMBER: 25                              CTRL CODE ABBREVIATION: LLI&lt;br /&gt;
  FULL NAME: LASER LABEL INIT&lt;br /&gt;
  CONTROL CODE: W $C(27),&amp;quot;&amp;amp;r1F&amp;quot;,$C(27),&amp;quot;E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;&amp;amp;u300D&amp;quot;,$C(27),&lt;br /&gt;
&amp;quot;&amp;amp;l3A&amp;quot;,$C(27),&amp;quot;&amp;amp;l0E&amp;quot;,!&lt;br /&gt;
NUMBER: 26                              CTRL CODE ABBREVIATION: MLI&lt;br /&gt;
  FULL NAME: MAILING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=175,PSOYI=50&lt;br /&gt;
NUMBER: 27                              CTRL CODE ABBREVIATION: NR&lt;br /&gt;
  FULL NAME: NORMAL ROTATION            CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a0P&amp;quot;&lt;br /&gt;
NUMBER: 28                              CTRL CODE ABBREVIATION: PFDI&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOY=690,PSOYI=40,PSOYM=969&lt;br /&gt;
NUMBER: 29                              CTRL CODE ABBREVIATION: PFDQ&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT QUANTITY&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOCX=200,PSOY=970,PSOYI=50,PSOQFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;&lt;br /&gt;
NUMBER: 30                              CTRL CODE ABBREVIATION: PFDT&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT TRAILER&lt;br /&gt;
  CONTROL CODE: S PSOY=1015,PSOYI=45,PSOX=0,PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=50,PSOTFONT=&amp;quot;F9&lt;br /&gt;
&amp;quot;,PSOBY=1280&lt;br /&gt;
NUMBER: 31                              CTRL CODE ABBREVIATION: PFDW&lt;br /&gt;
  FULL NAME: PHARMACY FILL DOCUMENT WARNING&lt;br /&gt;
  CONTROL CODE: S PSOY=1258,PSOX=660,PSOYI=30,PSOFONT=&amp;quot;F8&amp;quot;,PSOYM=1329&lt;br /&gt;
NUMBER: 32                              CTRL CODE ABBREVIATION: PFI&lt;br /&gt;
  FULL NAME: PATIENT FILL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=710,PSOYI=45,PSOHFONT=&amp;quot;F12&amp;quot;,PSOBY&lt;br /&gt;
I=100&lt;br /&gt;
NUMBER: 33                              CTRL CODE ABBREVIATION: PII&lt;br /&gt;
  FULL NAME: PATIENT INSTRUCTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1210,PSOY=760,PSOFONT=&amp;quot;F12&amp;quot;&lt;br /&gt;
NUMBER: 34                              CTRL CODE ABBREVIATION: PMII&lt;br /&gt;
  FULL NAME: PMI SECTION INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=0,PSOY=1350,PSOYI=50,PSOFONT=&amp;quot;F10&amp;quot;,PSOYM=3899&lt;br /&gt;
NUMBER: 35                              CTRL CODE ABBREVIATION: RMI&lt;br /&gt;
  FULL NAME: RETURN MAIL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOHFONT=&amp;quot;F8&amp;quot;,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1680,PSOY=35,PSORYI=40,PSOHYI&lt;br /&gt;
=40,PSOTFONT=&amp;quot;F8&amp;quot;,PSOTY=550&lt;br /&gt;
NUMBER: 36                              CTRL CODE ABBREVIATION: RNI&lt;br /&gt;
  FULL NAME: REFILL NARRATIVE INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOY=2860,PSOFONT=&amp;quot;F10&amp;quot;,PSOX=0,PSOYI=50,PSOYM=3950&lt;br /&gt;
NUMBER: 37                              CTRL CODE ABBREVIATION: RPI&lt;br /&gt;
  FULL NAME: REFILL PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOBYI=65,PSOTYI=50,PSOLX=0,PSORX=1210,PSOY=1350&lt;br /&gt;
,PSOYM=3650,PSOXI=90,PSOSYI=135&lt;br /&gt;
NUMBER: 38                              CTRL CODE ABBREVIATION: RT&lt;br /&gt;
  FULL NAME: ROTATE TEXT                CONTROL CODE: W $C(27),&amp;quot;&amp;amp;a90P&amp;quot;&lt;br /&gt;
NUMBER: 39                              CTRL CODE ABBREVIATION: SBT&lt;br /&gt;
  FULL NAME: START OF BARCODE TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;,$C(27),&amp;quot;(s1p14&lt;br /&gt;
.4v6,18b6,18s24670T&amp;quot;&lt;br /&gt;
NUMBER: 40                              CTRL CODE ABBREVIATION: SPI&lt;br /&gt;
  FULL NAME: SUSPENSE PRINT INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOFONT=&amp;quot;F10&amp;quot;,PSOX=1210,PSOY=1350,PSOYI=50,PSOCX=1775,PSOYM=27&lt;br /&gt;
00&lt;br /&gt;
NUMBER: 41                              CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: START OF TEXT&lt;br /&gt;
  CONTROL CODE: S PSOY=PSOY+PSOYI W $C(27),&amp;quot;*p&amp;quot;,PSOX,&amp;quot;x&amp;quot;,PSOY,&amp;quot;Y&amp;quot;&lt;br /&gt;
NUMBER: 42                              CTRL CODE ABBREVIATION: WLI&lt;br /&gt;
  FULL NAME: WARNING LABEL INITIALIZATION&lt;br /&gt;
  CONTROL CODE: S PSOX=1050,PSOY=55&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zebra Subtypes ===&lt;br /&gt;
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 shrunk. 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&#039;t use them.&lt;br /&gt;
&lt;br /&gt;
==== ZPL II Commands Cheat Sheet ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA - Start Label&lt;br /&gt;
^XZ - End Label&lt;br /&gt;
^LL - Label Length (Height)&lt;br /&gt;
^PW - Print Width&lt;br /&gt;
^CF - Set default Font&lt;br /&gt;
^LH - Label Home (Set a specific point to be the 0,0 coordinate for printing)&lt;br /&gt;
^A - Specify a font for the next ^FD (Field Definition). Resets to ^CF font after ^FD.&lt;br /&gt;
^CI - Change font encoding. 0 is USA-1, 28 is UTF-8, 30 is UTF-16 LE&lt;br /&gt;
^FR - Field Reverse Print; like reverse video for monitors&lt;br /&gt;
^FD - Field Data: contains what to print&lt;br /&gt;
^FS - Field Separator: End field data&lt;br /&gt;
^FB - Field Block: Allows you to print text with word wrapping&lt;br /&gt;
^BY - Bar Code Field Default: sets size of barcode.&lt;br /&gt;
^B3 - Code 39 barcode&lt;br /&gt;
^BC - Code 128 barcode&lt;br /&gt;
^BX - Datamatrix Barcode&lt;br /&gt;
^BQ - QR Barcode&lt;br /&gt;
^PH - Form Feed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Lab Label ====&lt;br /&gt;
This is 1&amp;quot; x 2&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-LAB&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW406.4^CFD,18,10^LH25,10&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W &amp;quot;^XZ&amp;quot;                DESCRIPTION: Zebra Lab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy BCMA Label ====&lt;br /&gt;
This is 1&amp;quot; x 3.5&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-BCMA                &lt;br /&gt;
  RIGHT MARGIN: 80                      FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 10                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
NUMBER: 1                               CTRL CODE ABBREVIATION: SL&lt;br /&gt;
  FULL NAME: Start Label                CONTROL CODE: W !,&amp;quot;^XA&amp;quot;,!,&amp;quot;^LH0,0^FS&amp;quot;&lt;br /&gt;
NUMBER: 2                               CTRL CODE ABBREVIATION: EL&lt;br /&gt;
  FULL NAME: End Label                  CONTROL CODE: W !,&amp;quot;^XZ&amp;quot;&lt;br /&gt;
NUMBER: 3                               CTRL CODE ABBREVIATION: EB&lt;br /&gt;
  FULL NAME: End Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO20,150^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 4                               CTRL CODE ABBREVIATION: SB&lt;br /&gt;
  FULL NAME: Start Barcode&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^BY1,2.0^FO650,25^BXN,3,200^FD&amp;quot;_PSBBAR_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 5                               CTRL CODE ABBREVIATION: ST&lt;br /&gt;
  FULL NAME: Start Text&lt;br /&gt;
  CONTROL CODE: W !,&amp;quot;^FO&amp;quot;_PSBTYPE_&amp;quot;^A0N,30,20^CI13^FR^FD&amp;quot;_TEXT_&amp;quot;^FS&amp;quot;&lt;br /&gt;
NUMBER: 6                               CTRL CODE ABBREVIATION: STF&lt;br /&gt;
  FULL NAME: Start Text Field&lt;br /&gt;
  CONTROL CODE: S PSBTYPE=$S(PSBTLE=&amp;quot;PSBDRUG&amp;quot;:&amp;quot;20,25&amp;quot;,PSBTLE=&amp;quot;PSBDOSE&amp;quot;:&amp;quot;20,60^FB&lt;br /&gt;
320,5&amp;quot;,PSBTLE=&amp;quot;PSBNAME&amp;quot;:&amp;quot;350,60&amp;quot;,PSBTLE=&amp;quot;PSBWARD&amp;quot;:&amp;quot;350,90&amp;quot;,PSBTLE=&amp;quot;PSBLOT&amp;quot;:&amp;quot;350,&lt;br /&gt;
120&amp;quot;,PSBTLE=&amp;quot;PSBEXP&amp;quot;:&amp;quot;350,150&amp;quot;,PSBTLE=&amp;quot;PSBMFG&amp;quot;:&amp;quot;500,150&amp;quot;,PSBTLE=&amp;quot;PSBFCB&amp;quot;:&amp;quot;350,18&lt;br /&gt;
0&amp;quot;,1:&amp;quot;0,0&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pharmacy Unit Dose Label (vxVistA only) ====&lt;br /&gt;
VA VistA uses a dot matrix printer printing on a sheet of 1&amp;quot; x 3.5&amp;quot; x 2 columns.&lt;br /&gt;
vxVistA was written to use Unit Dose labels. This is 1&amp;quot; x 3.5&amp;quot; single column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-ZEBRA-PHARM-UD&lt;br /&gt;
  RIGHT MARGIN: 132                     FORM FEED: #&lt;br /&gt;
  PAGE LENGTH: 64                       BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W &amp;quot;^XA^LL203.2^PW711.2^CFD,18,10^LH15,25^XZ&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Support for Advanced Subtype Specifiers ==&lt;br /&gt;
If you look at [http://www.va.gov/vdl/documents/Infrastructure/Kernel/krn8_0sm.pdf|the 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.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LASER;P-LASER-LANDSCAPE;/M132L100P16BQ2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
How to set up a device to support this isn&#039;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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  10 PITCH: $C(27)_&amp;quot;(s10h&amp;quot;              12 PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
  HIGH INTENSITY (BOLD): $C(27)_&amp;quot;(s3b&amp;quot;  LOW INTENSITY (UNBOLD): $C(27)_&amp;quot;(s-3b&amp;quot;&lt;br /&gt;
  NORMAL INTENSITY (RESET): $C(27)_&amp;quot;(s0b&amp;quot;&lt;br /&gt;
  16 PITCH: $C(27)_&amp;quot;(s16h&amp;quot;              DEFAULT PITCH: $C(27)_&amp;quot;(s12h&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&#039;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&#039;t support &#039;Q&#039; in the configuration above, so it has no effect; that&#039;s because &#039;Q&#039; is nonsensical when using laser printers. It had a use back in the dot-matrix days.&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=Setting_up_a_VISTA_Printer&amp;diff=17203</id>
		<title>Setting up a VISTA Printer</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=Setting_up_a_VISTA_Printer&amp;diff=17203"/>
		<updated>2016-10-24T22:49:03Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Avoiding the Staircase effect when printing from GT.M/Cache on *Nix with Laser Printers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Programming VistA Issues]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
This is an updated page. See [[Setting_up_a_Linux_Printer_Old|this page]] for old content.&lt;br /&gt;
&lt;br /&gt;
== Setting Up a Printer in VISTA ==&lt;br /&gt;
In order to set-up a printer in VISTA, there are three steps:&lt;br /&gt;
&lt;br /&gt;
* Add printer to CUPS or to Windows Printer list. The printers may be on remote servers, as long as the VISTA machine can access them.&lt;br /&gt;
* In VISTA, you need to create an entry that represents the printer formatting characteristics in the terminal type file (#3.2)&lt;br /&gt;
* Then you need to create an entry in the device file (#3.5) that corresponds to the printer&lt;br /&gt;
&lt;br /&gt;
In practice, you don&#039;t need to do the second step because there are only about 5 commonly used subtypes in VISTA which you reuse.&lt;br /&gt;
&lt;br /&gt;
A Subtype is a file entry that contains the code to send to the printer, to open the printer, reset the printer, select the page size, adjust the margins, select the font etc.&lt;br /&gt;
&lt;br /&gt;
=== Subtypes ===&lt;br /&gt;
&lt;br /&gt;
Information about subtypes, including the most common subtypes, is listed [[VISTA_Printing_Printer_Subtypes|here]].&lt;br /&gt;
&lt;br /&gt;
=== Cache/Windows printing ===&lt;br /&gt;
When you specify a printer name in $I, Cache/Windows sends raw input directly to the printer, bypassing the driver. This makes setting up a printer on Windows easy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: BROTHER                           $I: |PRN|\\VXQA\HL2270DW&lt;br /&gt;
  LOCATION OF TERMINAL: QA              SUBTYPE: P-HP-LASER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, all you have to do is put the printer name after |PRN| in $I. You can specify local printers; or you can specify shared printers using a UNC path (as shown above).&lt;br /&gt;
&lt;br /&gt;
=== Cache/Linux printing ===&lt;br /&gt;
You can use Pipes in Cache to print on Linux/Unix. Here&#039;s an operative example. Based on my experience, this is the best way to do it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM&#039;S PHARMACY PRINTER            $I: /usr/bin/lpr -PSAN_FL6 -l&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;QW&amp;quot;                 SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that there is a bug in DEVOK^%ZOSV (ZOSVONT) that prevents it from checking the device properly. This will show up if you misconfigure a device and then use it in Taskman. Short of fixing this, here is how to remove the bad prints from Taskman:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S (DEV,ZTIME,ZTSK)=&amp;quot;&amp;quot; F  S DEV=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV)) Q:DEV=&amp;quot;&amp;quot;  F  S ZTIME=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV,ZTIME)) Q:&#039;ZTIME  F  S ZTSK=$O(^%ZTSCH(&amp;quot;IO&amp;quot;,DEV,ZTIME,ZTSK)) Q:&#039;ZTSK  D DQ^%ZTLOAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the method developed but not adopted by the VA in patch [http://foia-vista.osehra.org/Patches_By_Application/XU-KERNEL/XU-8_SEQ-485_PAT-585.TXT XU*8.0*585]. After attempting to use this method in production, I would recommend against it, because a. CPRS and BCMA code is not configured to pick up PQ devices and b. %ZISC has issues with PQ devices. I have fixed both of these issues; but the code for this is not in VISTA yet.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample device that uses the XU*8.0*585 method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PRINTER_NAME                          $I: PRINTER_NAME&lt;br /&gt;
  PURGE OLD PRINT QUEUE FILES: YES      LOCATION OF TERMINAL: Cups Device&lt;br /&gt;
  SUBTYPE: P-HP-LTR-POR-C17L7-W128-NOFF TYPE: PRINT QUEUE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GT.M/Linux printing ===&lt;br /&gt;
Pipes again; just like Cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em&amp;quot;&amp;gt;&lt;br /&gt;
NAME: PHAR-IP-DM                        $I: PHAR-IP-DM&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Dot-Matrix&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -l -P PHAR-IP-DM 2&amp;gt;/dev/null&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
  SUBTYPE: P-EPSON-DM-P15-5L&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-LS                        $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Landscape&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
  SUBTYPE: P-HPLJ4SI-P13-LS&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-POR-P12                   $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Portrait (PL)&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
MNEMONIC: PL&lt;br /&gt;
  SUBTYPE: P-HPLJ4SI-P12                TYPE: TERMINAL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NAME: PHAR-IP-POR-P16                   $I: PHAR-IP&lt;br /&gt;
  LOCATION OF TERMINAL: Inpatient Pharmacy Portrait (MAR)&lt;br /&gt;
  OPEN PARAMETERS: (shell=&amp;quot;/bin/sh&amp;quot;:comm=&amp;quot;lpr -P PHAR-IP -l&amp;quot;:WRITEONLY)::&amp;quot;pipe&amp;quot;&lt;br /&gt;
MNEMONIC: MAR&lt;br /&gt;
  SUBTYPE: P-HPLJ2-P16                  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How does printing from VISTA work? ===&lt;br /&gt;
How does this work?&lt;br /&gt;
The way this works is that $I becomes the IO variable. The open&lt;br /&gt;
parameters tells VISTA how to open the device.&lt;br /&gt;
&lt;br /&gt;
Vista does this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S IO=[$I]&lt;br /&gt;
S param=[OPEN PARAMETERS]&lt;br /&gt;
O IO:param&lt;br /&gt;
U IO&lt;br /&gt;
Send Open Execute from Subtype&lt;br /&gt;
U IO(0)&lt;br /&gt;
Interact with user; open another job, etc...&lt;br /&gt;
U IO&lt;br /&gt;
write write write&lt;br /&gt;
Send Close Execute from Subtype&lt;br /&gt;
C IO&lt;br /&gt;
etc.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No need to do pre-open and post-close executes on the device which dynamically changes IOs.&lt;br /&gt;
&lt;br /&gt;
=== Avoiding the Staircase effect when printing from GT.M/Cache on *Nix with Laser Printers ===&lt;br /&gt;
For an explanation of the Staircase effect, see this:&lt;br /&gt;
http://www.digitalissues.co.uk/html/os/unix/stair.html&lt;br /&gt;
&lt;br /&gt;
Basically, the new line doesn&#039;t include a carriage return, so our output just flows off the page. So when you print a 10 line document, you may only see one line, as the rest was printed outside of the margin.&lt;br /&gt;
&lt;br /&gt;
If you are sending raw output (lpr with the -l option) from VISTA to any PCL compatible printer (and VISTA by and large uses PCL for formatting plain text output), you need to add this to your open execute:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em&amp;quot;&amp;gt;&lt;br /&gt;
W $C(27),&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the PCL compatible printer to append a CR to each LF or FF.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you are asking CUPS to handle the formatting (lpr without the -l option), CUPS properly formats the line returns through a CUPS filter, so you don&#039;t have to do anything.&lt;br /&gt;
&lt;br /&gt;
=== Advanced printing topics ===&lt;br /&gt;
[[VISTA_Advanced_printing_topics|Advanced printing topics]]&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17202</id>
		<title>VISTA Advanced printing topics</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17202"/>
		<updated>2016-10-24T22:45:56Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Finding the ready status of a print queue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Advanced Printing Topics =&lt;br /&gt;
Authored mainly by Sam Habiel, the printer &amp;quot;sensei.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How do computers communicate with printers, software-wise? ==&lt;br /&gt;
This is a pretty difficult topic. Cheaper printers only accept binary data that is hardcoded by the computers; typically these printers are only supported on Windows, and thus are named &amp;quot;Winprinters.&amp;quot; Higher end printers have a processor on them that can typically interpret PCL5, PCL6, and PS; and possibly PDF. These printers are easily supported in Linux. Commercial label printers (like Zebras) always accept their own programming language.&lt;br /&gt;
&lt;br /&gt;
== VISTA and what it really sends ==&lt;br /&gt;
VISTA sends PCL5 to laser printers; or a printer specific language for label printers--most commonly ZPL II for Zebra printers. For laser printers, you need to make sure that your printer supports PCL5. All HP Printers support PCL5, no matter how cheap; other manufacturers only support it on their higher end printers (not too high end--anything that isn&#039;t the cheapest printer may support PCL5). If you need to look it up, go to the manufacturer&#039;s website and look at the technical specs sheet. The section is typically called &amp;quot;supported emulations,&amp;quot; or &amp;quot;supported languages.&amp;quot; What VISTA sends is determined by the sub-type defined for the device.&lt;br /&gt;
&lt;br /&gt;
== Communicating with a printer on the network for the first time ==&lt;br /&gt;
Nothing prevents you from using a USB printer or even a parallel port printer, but in my experience, nobody uses those interfaces in production anymore.&lt;br /&gt;
&lt;br /&gt;
Get the IP address first. You can usually obtain that by printing an information sheet from the printer. Consult the printer manual to find out how to print that information sheet. You can also try to identify the printer from the list of connected hosts on your network.&lt;br /&gt;
&lt;br /&gt;
Whenever I set up a new printer, I tend to ensure that I can talk to it directly, with nothing in the middle. I use the netcat command (&#039;nc&#039;) to do that, connecting to the IP address of the printer on port 9100. Make sure to add the -v flag to netcat so that it can report whether it succeeded in connecting at all. It is very possible that you connected to a printer but you just don&#039;t know which one.&lt;br /&gt;
&lt;br /&gt;
(Aside: This can be done from VISTA using D CALL^%ZISTCP(ip_address,port,time_out)--but netcat is easier.)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of me trying to talk to a PCL printer, so it will print the word &amp;quot;test&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;TEST&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and here&#039;s an example printing a Datamatrix code on a Zebra printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;^XA^FO50,100^BXN,10,200^FDTESTTEST^FS^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A successful connection will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Connection to XX.XX.XX.XX 9100 port [tcp/jetdirect] succeeded!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An unsuccessful connection will either just hang or tell you connection refused.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nc: connect to XXXXXXXXX port 9100 (tcp) failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up the printer in the operating system ==&lt;br /&gt;
After confirming the connection, you need to set up the printer in the operating system. VISTA does NOT need any drivers for the printers to be installed.&lt;br /&gt;
&lt;br /&gt;
== Setting up a printer in VISTA ==&lt;br /&gt;
See [[Setting_up_a_VISTA_Printer|this page]].&lt;br /&gt;
&lt;br /&gt;
== Testing Printers ==&lt;br /&gt;
To test printers in VISTA after setting it up, there are a few steps you have to go through.&lt;br /&gt;
&lt;br /&gt;
If you run this on Caché, Caché steals your IO device between prompts. Therefore U IO to D ^%ZISC need to be on a single line. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U IO W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Invoke via %ZIS first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
D ^%ZIS&lt;br /&gt;
&lt;br /&gt;
DEVICE: HOME//MY PRINTER&lt;br /&gt;
&lt;br /&gt;
U IO&lt;br /&gt;
&lt;br /&gt;
W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the output. If it&#039;s okay, you are ready to move to the next step. If you see the &amp;quot;staircase&amp;quot; effect, you need to go back and set-up the terminal type correctly [[Setting_up_a_Linux_Printer|here]].&lt;br /&gt;
&lt;br /&gt;
The next menu option to try is Send Test Pattern to Terminal [XUTTEST]. If that works, then you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Various troubleshooting topics -- how fun! ==&lt;br /&gt;
There are various issues that come up regularly with VISTA.&lt;br /&gt;
&lt;br /&gt;
=== Laser Printer Issues ===&lt;br /&gt;
Use this page as a reference for PCL:&lt;br /&gt;
&lt;br /&gt;
http://www.pclviewer.com/resources/reference/&lt;br /&gt;
&lt;br /&gt;
==== Extra pages ====&lt;br /&gt;
Extra pages can happen for three different reasons:&lt;br /&gt;
 &lt;br /&gt;
* By default, VISTA prints an extra page after each print job. This is for historical reasons; as most of the early printers were dot-matrix. Today, it&#039;s recommended that this be disabled. To disable the extra page, you can do it at the device level or the terminal type level. At the device level, set &amp;lt;code&amp;gt;SUPPRESS FORM FEED AT CLOSE&amp;lt;/code&amp;gt; to yes. For the terminal type, set &amp;lt;code&amp;gt;CLOSE EXECUTE&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* The text doesn&#039;t fit the page and spills over to the next page. VISTA printing options must follow the IOSL value (Page Length in Terminal Type or Device--Device overrides Terminal Type). Most of the time this has to do with the fact that the text size for the report is too large; or that the margins are not appropriate. Based on visual inspection, you should decide what to do. The unlikely case is that the VISTA programmer is not obeying IOSL; but that is for you to determine.&lt;br /&gt;
* If both of the above fail, it&#039;s likely that VISTA sends a hard coded form feed to the printer. You need to capture the output by capturing the print to a file (use HFS;subtype) and visually examine it in a programming editor.&lt;br /&gt;
&lt;br /&gt;
==== Wrapping ====&lt;br /&gt;
Typically this has to do with whether the printer is configured to take 132 characters or 80 characters; if not, then it has to do with the font size.&lt;br /&gt;
&lt;br /&gt;
VISTA has these typical formats for printing:&lt;br /&gt;
&lt;br /&gt;
* 12 cpi 8 lpi Portrait (most reports)&lt;br /&gt;
* 17 cpi 7 lpi Portrait (MAR)&lt;br /&gt;
* 14 cpi 6 lpi Landscape (132 wide reports)&lt;br /&gt;
* 22 cpi 12 lpi Landscape (228 wide reports)&lt;br /&gt;
&lt;br /&gt;
==== Only a single line prints ====&lt;br /&gt;
You are seeing the staircase effect. See the Staircase section in [[Setting_up_a_VISTA_Printer]].&lt;br /&gt;
&lt;br /&gt;
=== Zebra Printer Issues ===&lt;br /&gt;
From my memory, these are typically the issues you face:&lt;br /&gt;
&lt;br /&gt;
* Label not aligned vertically&lt;br /&gt;
* Label not aligned horizontally&lt;br /&gt;
* Labels are not dark enough.&lt;br /&gt;
* Label gets cut off&lt;br /&gt;
* VISTA printed labels are too small&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned vertically ====&lt;br /&gt;
Zebras mostly auto calibrate printing on continuous media. Check your Zebra&#039;s manual on how to do that for the specific model.&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned horizontally ====&lt;br /&gt;
Zebras don&#039;t auto align to the width. You have to set the print width yourself. They can detect the start of the label though.&lt;br /&gt;
&lt;br /&gt;
To do that, find your printer dpi setting, and multiply that by the width of your label. E.g. 202 dpi with 3.5&amp;quot;, you need to run this command from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA^PW707^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn&#039;t solve your problem, you need to look carefully at the actual feeding of the label into the zebra printer. Read the manual carefully. I have seen many people &amp;quot;wing it&amp;quot; and do it incorrectly. I have even seen a printer where the left margin guide wasn&#039;t used and a rubber band was placed there. After you turn off or restart the printer, it tries to self calibrate.&lt;br /&gt;
&lt;br /&gt;
==== Label Text is not dark enough ====&lt;br /&gt;
There are two tunable circle things on the top of the print head that can be turned to increase the darkness. Try that. There is also a Zebra setting that can be changed to increase the darkness.&lt;br /&gt;
&lt;br /&gt;
==== Label gets cut off ====&lt;br /&gt;
If the label gets cut off on the right hand side of the label, check your print width (see &#039;Label not aligned horizontally&#039;), and if that&#039;s not the issue, check the position of the ribbon vis a vis the labels. The printer may be trying to print, but there is no ribbon at the place it&#039;s trying to print. If it is getting cut off from the left side, check that your labels are using the left hand guide and are not colliding with it. If it is getting cut off vertically, you need to calibrate the printer. If it still gets cut off, you need to capture the ZPL II that is sent by VISTA and see 1. that it&#039;s formatted correctly and 2. that there isn&#039;t too much information to print.&lt;br /&gt;
&lt;br /&gt;
==== VISTA printed labels are too small ====&lt;br /&gt;
This means that you bought a Zebra printer with the wrong dpi. You have to return it and buy another one. VISTA wants printers with 202 DPI. If you want to use the new printer, you need to re-write some of the label code.&lt;br /&gt;
&lt;br /&gt;
=== Advanced troubleshooting ===&lt;br /&gt;
If you are stuck with a particularly difficult problem, it may be useful to capture the PCL and use a PCL emulator and print to a PDF; or ZPL II and use a Zebra emulator.&lt;br /&gt;
&lt;br /&gt;
To capture an output from VISTA, you need to create a device whose type is HFS but whose destination is pre-determined. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM-DIRECT-HFS-PRINTER            $I: /tmp/op-dev6-lbl-sam.pcl&lt;br /&gt;
  LOCATION OF TERMINAL: File&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;NWS&amp;quot;                SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: HOST FILE SERVER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to change the file for each job, so that they won&#039;t overwrite each other, you can append something to IO in the pre-open execute. Please note that you need to change &amp;quot;NWS&amp;quot; to (newversion) on GT.M.&lt;br /&gt;
&lt;br /&gt;
This is the emulator I use for PCL, http://www.ghostscript.com/GhostPCL.html.&lt;br /&gt;
This is the emulator I use for ZPL II, http://labelary.com/viewer.html&lt;br /&gt;
&lt;br /&gt;
To use GhostPCL, here is a sample invocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat vista_print-0001.pcl | C:\Users\shabiel\workspace\ghostpcl-9.15-win32\pcl6-9.15-win32.exe -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -r600 -sOutputFile=&amp;quot;testpdf.sam&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical PCL String ==&lt;br /&gt;
To construct a PCL in VISTA, you typically put everything in the Open Execute. The Close Execute should always be set to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt; unless you want to do something special. The Form Feed accepts PCL as well.&lt;br /&gt;
&lt;br /&gt;
The typical PCL sequence for an Open Execute is as follows:&lt;br /&gt;
&lt;br /&gt;
* Reset&lt;br /&gt;
* Set Line Carriage mode (CR, CRLF, or LF)&lt;br /&gt;
* Set Orientation (Portrait or Landscape)&lt;br /&gt;
* Set Character Set (optional; not needed for US printing; may need to change for Spanish)&lt;br /&gt;
* Set Margins (optional; but you will probably need it at some point)&lt;br /&gt;
* Set Font&lt;br /&gt;
&lt;br /&gt;
When constructing a string, I recommend using *27 rather than $C(27) because it&#039;s shorter, and you will type a lot of it.&lt;br /&gt;
&lt;br /&gt;
An example. Note that this needs to be all in one string. It&#039;s separated here for education.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W *27,&amp;quot;E&amp;quot;    ; Reset&lt;br /&gt;
W *27,&amp;quot;&amp;amp;k2G&amp;quot; ; Set Carriage mode to LF.&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l0O&amp;quot; ; Portrait; Landscape is 1O.&lt;br /&gt;
...          ; Character Set Omitted&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l4E&amp;quot; ; Top Margin 4 lines&lt;br /&gt;
W *27,&amp;quot;&amp;amp;a5L&amp;quot; ; Left Margin 5 columns&lt;br /&gt;
W *27,&amp;quot;(s0p12h0s0b4099T&amp;quot; ; Fixed Pitch; 12 cpi, fixed pitch for secondary font, Medium Weight, select courier font.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Functions ==&lt;br /&gt;
I won&#039;t document this in detail, but here are some advanced examples. These ones do headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80-HD         RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p12h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5&lt;br /&gt;
L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h&lt;br /&gt;
0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot; S ($X,$&lt;br /&gt;
Y)=0                                    CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128-HD        RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p17h9v0s0b0T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;l7C&amp;quot;_$C(27&lt;br /&gt;
)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;#&amp;quot;,&amp;quot;&amp;quot;)                     PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(2&lt;br /&gt;
7),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,*27,&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&lt;br /&gt;
(s0p17h9v0s0b0T&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27,69)&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228-HD      RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p22h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p22h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132-HD       RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p14h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 46&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p14h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this one does a watermark:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-PORTRAIT-C16L7-WM            SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96&lt;br /&gt;
  FORM FEED: $c(27)_&amp;quot;*c5760x6000Y&amp;quot;_$c(27)_&amp;quot;*p150x150Y&amp;quot;_$c(27)_&amp;quot;*c0T&amp;quot;_$c(27)_&amp;quot;%1B&lt;br /&gt;
IN;SP1;DI1,-1;SD2,1,4,140,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;_$c&lt;br /&gt;
(3,27)_&amp;quot;%1A&amp;quot;_$c(12)                     PAGE LENGTH: 60&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;(8U&amp;quot;,*27,&amp;quot;(s0P&amp;quot;,*27,&amp;quot;(s16H&amp;quot;,*27,&amp;quot;(s9V&amp;quot;,*27,&amp;quot;(s0S&amp;quot;&lt;br /&gt;
,*27,&amp;quot;(s-3B&amp;quot;,*27,&amp;quot;(s0T&amp;quot;,*27,&amp;quot;&amp;amp;l88P&amp;quot;,*27,&amp;quot;&amp;amp;a255M&amp;quot;,*27,&amp;quot;&amp;amp;k2S&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot;,*27,&amp;quot;&amp;amp;s1C&lt;br /&gt;
&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W *27,&amp;quot;*c5760x6000Y&amp;quot;,*27,&amp;quot;*p150x150Y&amp;quot;,*27,&amp;quot;*c0T&amp;quot;,*27,&amp;quot;%1B&amp;quot;,&amp;quot;IN;&lt;br /&gt;
SP1;DI1,-1;SD1,21,2,1,4,140,5,0,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;&lt;br /&gt;
_$C(3),*27,&amp;quot;%1A&amp;quot;                     DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing PDFs from VISTA ==&lt;br /&gt;
Using GhostPCL, you can directly print out a PDF from VISTA. Here&#039;s an example in GT.M on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PDF WRITER                        $I: PDF-WRITER&lt;br /&gt;
  LOCATION OF TERMINAL: /tmp/           &lt;br /&gt;
  OPEN PARAMETERS: (comm=&amp;quot;pcl6 -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -SOutputFile=&lt;br /&gt;
/tmp/green-sheet.pdf -&amp;quot;)::&amp;quot;pipe&amp;quot;        SUBTYPE: P-HP BARCODER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, you can add a Windows printer that automatically calls GhostPCL. You need to use this amazing piece of software:&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/mfilemon/&lt;br /&gt;
&lt;br /&gt;
Once you install it and configure it, you need to set the $I appropriately.&lt;br /&gt;
&lt;br /&gt;
== Finding the TCP/IP address for a print queue name ==&lt;br /&gt;
On Linux, the lpstat command tells you details about the print queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -v&lt;br /&gt;
&lt;br /&gt;
device for TEST-01: socket://192.168.10.3:9100&lt;br /&gt;
&lt;br /&gt;
device for TEST-02: socket://192.168.10.4:9100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the ready status of a print queue ==&lt;br /&gt;
&lt;br /&gt;
On Linux, the lpstat command tells you all the printers and what their status is.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -a&lt;br /&gt;
&lt;br /&gt;
TEST-01 accepting requests since Sun 25 Dec 2005 09:54:34 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-02 accepting requests since Thu 28 Nov 2013 09:56:11 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-03 accepting requests since Fri 17 Mar 2017 10:03:00 AM EST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or for a particular printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -p  TEST-03&lt;br /&gt;
&lt;br /&gt;
printer TEST-03 is idle.  enabled since Fri 17 Mar 2017 08:39:00 AM EDT&lt;br /&gt;
        Ready to print.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17201</id>
		<title>VISTA Advanced printing topics</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17201"/>
		<updated>2016-10-24T22:42:43Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Typical PCL String */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Advanced Printing Topics =&lt;br /&gt;
Authored mainly by Sam Habiel, the printer &amp;quot;sensei.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How do computers communicate with printers, software-wise? ==&lt;br /&gt;
This is a pretty difficult topic. Cheaper printers only accept binary data that is hardcoded by the computers; typically these printers are only supported on Windows, and thus are named &amp;quot;Winprinters.&amp;quot; Higher end printers have a processor on them that can typically interpret PCL5, PCL6, and PS; and possibly PDF. These printers are easily supported in Linux. Commercial label printers (like Zebras) always accept their own programming language.&lt;br /&gt;
&lt;br /&gt;
== VISTA and what it really sends ==&lt;br /&gt;
VISTA sends PCL5 to laser printers; or a printer specific language for label printers--most commonly ZPL II for Zebra printers. For laser printers, you need to make sure that your printer supports PCL5. All HP Printers support PCL5, no matter how cheap; other manufacturers only support it on their higher end printers (not too high end--anything that isn&#039;t the cheapest printer may support PCL5). If you need to look it up, go to the manufacturer&#039;s website and look at the technical specs sheet. The section is typically called &amp;quot;supported emulations,&amp;quot; or &amp;quot;supported languages.&amp;quot; What VISTA sends is determined by the sub-type defined for the device.&lt;br /&gt;
&lt;br /&gt;
== Communicating with a printer on the network for the first time ==&lt;br /&gt;
Nothing prevents you from using a USB printer or even a parallel port printer, but in my experience, nobody uses those interfaces in production anymore.&lt;br /&gt;
&lt;br /&gt;
Get the IP address first. You can usually obtain that by printing an information sheet from the printer. Consult the printer manual to find out how to print that information sheet. You can also try to identify the printer from the list of connected hosts on your network.&lt;br /&gt;
&lt;br /&gt;
Whenever I set up a new printer, I tend to ensure that I can talk to it directly, with nothing in the middle. I use the netcat command (&#039;nc&#039;) to do that, connecting to the IP address of the printer on port 9100. Make sure to add the -v flag to netcat so that it can report whether it succeeded in connecting at all. It is very possible that you connected to a printer but you just don&#039;t know which one.&lt;br /&gt;
&lt;br /&gt;
(Aside: This can be done from VISTA using D CALL^%ZISTCP(ip_address,port,time_out)--but netcat is easier.)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of me trying to talk to a PCL printer, so it will print the word &amp;quot;test&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;TEST&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and here&#039;s an example printing a Datamatrix code on a Zebra printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;^XA^FO50,100^BXN,10,200^FDTESTTEST^FS^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A successful connection will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Connection to XX.XX.XX.XX 9100 port [tcp/jetdirect] succeeded!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An unsuccessful connection will either just hang or tell you connection refused.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nc: connect to XXXXXXXXX port 9100 (tcp) failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up the printer in the operating system ==&lt;br /&gt;
After confirming the connection, you need to set up the printer in the operating system. VISTA does NOT need any drivers for the printers to be installed.&lt;br /&gt;
&lt;br /&gt;
== Setting up a printer in VISTA ==&lt;br /&gt;
See [[Setting_up_a_VISTA_Printer|this page]].&lt;br /&gt;
&lt;br /&gt;
== Testing Printers ==&lt;br /&gt;
To test printers in VISTA after setting it up, there are a few steps you have to go through.&lt;br /&gt;
&lt;br /&gt;
If you run this on Caché, Caché steals your IO device between prompts. Therefore U IO to D ^%ZISC need to be on a single line. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U IO W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Invoke via %ZIS first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
D ^%ZIS&lt;br /&gt;
&lt;br /&gt;
DEVICE: HOME//MY PRINTER&lt;br /&gt;
&lt;br /&gt;
U IO&lt;br /&gt;
&lt;br /&gt;
W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the output. If it&#039;s okay, you are ready to move to the next step. If you see the &amp;quot;staircase&amp;quot; effect, you need to go back and set-up the terminal type correctly [[Setting_up_a_Linux_Printer|here]].&lt;br /&gt;
&lt;br /&gt;
The next menu option to try is Send Test Pattern to Terminal [XUTTEST]. If that works, then you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Various troubleshooting topics -- how fun! ==&lt;br /&gt;
There are various issues that come up regularly with VISTA.&lt;br /&gt;
&lt;br /&gt;
=== Laser Printer Issues ===&lt;br /&gt;
Use this page as a reference for PCL:&lt;br /&gt;
&lt;br /&gt;
http://www.pclviewer.com/resources/reference/&lt;br /&gt;
&lt;br /&gt;
==== Extra pages ====&lt;br /&gt;
Extra pages can happen for three different reasons:&lt;br /&gt;
 &lt;br /&gt;
* By default, VISTA prints an extra page after each print job. This is for historical reasons; as most of the early printers were dot-matrix. Today, it&#039;s recommended that this be disabled. To disable the extra page, you can do it at the device level or the terminal type level. At the device level, set &amp;lt;code&amp;gt;SUPPRESS FORM FEED AT CLOSE&amp;lt;/code&amp;gt; to yes. For the terminal type, set &amp;lt;code&amp;gt;CLOSE EXECUTE&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* The text doesn&#039;t fit the page and spills over to the next page. VISTA printing options must follow the IOSL value (Page Length in Terminal Type or Device--Device overrides Terminal Type). Most of the time this has to do with the fact that the text size for the report is too large; or that the margins are not appropriate. Based on visual inspection, you should decide what to do. The unlikely case is that the VISTA programmer is not obeying IOSL; but that is for you to determine.&lt;br /&gt;
* If both of the above fail, it&#039;s likely that VISTA sends a hard coded form feed to the printer. You need to capture the output by capturing the print to a file (use HFS;subtype) and visually examine it in a programming editor.&lt;br /&gt;
&lt;br /&gt;
==== Wrapping ====&lt;br /&gt;
Typically this has to do with whether the printer is configured to take 132 characters or 80 characters; if not, then it has to do with the font size.&lt;br /&gt;
&lt;br /&gt;
VISTA has these typical formats for printing:&lt;br /&gt;
&lt;br /&gt;
* 12 cpi 8 lpi Portrait (most reports)&lt;br /&gt;
* 17 cpi 7 lpi Portrait (MAR)&lt;br /&gt;
* 14 cpi 6 lpi Landscape (132 wide reports)&lt;br /&gt;
* 22 cpi 12 lpi Landscape (228 wide reports)&lt;br /&gt;
&lt;br /&gt;
==== Only a single line prints ====&lt;br /&gt;
You are seeing the staircase effect. See the Staircase section in [[Setting_up_a_VISTA_Printer]].&lt;br /&gt;
&lt;br /&gt;
=== Zebra Printer Issues ===&lt;br /&gt;
From my memory, these are typically the issues you face:&lt;br /&gt;
&lt;br /&gt;
* Label not aligned vertically&lt;br /&gt;
* Label not aligned horizontally&lt;br /&gt;
* Labels are not dark enough.&lt;br /&gt;
* Label gets cut off&lt;br /&gt;
* VISTA printed labels are too small&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned vertically ====&lt;br /&gt;
Zebras mostly auto calibrate printing on continuous media. Check your Zebra&#039;s manual on how to do that for the specific model.&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned horizontally ====&lt;br /&gt;
Zebras don&#039;t auto align to the width. You have to set the print width yourself. They can detect the start of the label though.&lt;br /&gt;
&lt;br /&gt;
To do that, find your printer dpi setting, and multiply that by the width of your label. E.g. 202 dpi with 3.5&amp;quot;, you need to run this command from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA^PW707^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn&#039;t solve your problem, you need to look carefully at the actual feeding of the label into the zebra printer. Read the manual carefully. I have seen many people &amp;quot;wing it&amp;quot; and do it incorrectly. I have even seen a printer where the left margin guide wasn&#039;t used and a rubber band was placed there. After you turn off or restart the printer, it tries to self calibrate.&lt;br /&gt;
&lt;br /&gt;
==== Label Text is not dark enough ====&lt;br /&gt;
There are two tunable circle things on the top of the print head that can be turned to increase the darkness. Try that. There is also a Zebra setting that can be changed to increase the darkness.&lt;br /&gt;
&lt;br /&gt;
==== Label gets cut off ====&lt;br /&gt;
If the label gets cut off on the right hand side of the label, check your print width (see &#039;Label not aligned horizontally&#039;), and if that&#039;s not the issue, check the position of the ribbon vis a vis the labels. The printer may be trying to print, but there is no ribbon at the place it&#039;s trying to print. If it is getting cut off from the left side, check that your labels are using the left hand guide and are not colliding with it. If it is getting cut off vertically, you need to calibrate the printer. If it still gets cut off, you need to capture the ZPL II that is sent by VISTA and see 1. that it&#039;s formatted correctly and 2. that there isn&#039;t too much information to print.&lt;br /&gt;
&lt;br /&gt;
==== VISTA printed labels are too small ====&lt;br /&gt;
This means that you bought a Zebra printer with the wrong dpi. You have to return it and buy another one. VISTA wants printers with 202 DPI. If you want to use the new printer, you need to re-write some of the label code.&lt;br /&gt;
&lt;br /&gt;
=== Advanced troubleshooting ===&lt;br /&gt;
If you are stuck with a particularly difficult problem, it may be useful to capture the PCL and use a PCL emulator and print to a PDF; or ZPL II and use a Zebra emulator.&lt;br /&gt;
&lt;br /&gt;
To capture an output from VISTA, you need to create a device whose type is HFS but whose destination is pre-determined. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM-DIRECT-HFS-PRINTER            $I: /tmp/op-dev6-lbl-sam.pcl&lt;br /&gt;
  LOCATION OF TERMINAL: File&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;NWS&amp;quot;                SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: HOST FILE SERVER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to change the file for each job, so that they won&#039;t overwrite each other, you can append something to IO in the pre-open execute. Please note that you need to change &amp;quot;NWS&amp;quot; to (newversion) on GT.M.&lt;br /&gt;
&lt;br /&gt;
This is the emulator I use for PCL, http://www.ghostscript.com/GhostPCL.html.&lt;br /&gt;
This is the emulator I use for ZPL II, http://labelary.com/viewer.html&lt;br /&gt;
&lt;br /&gt;
To use GhostPCL, here is a sample invocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat vista_print-0001.pcl | C:\Users\shabiel\workspace\ghostpcl-9.15-win32\pcl6-9.15-win32.exe -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -r600 -sOutputFile=&amp;quot;testpdf.sam&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical PCL String ==&lt;br /&gt;
To construct a PCL in VISTA, you typically put everything in the Open Execute. The Close Execute should always be set to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt; unless you want to do something special. The Form Feed accepts PCL as well.&lt;br /&gt;
&lt;br /&gt;
The typical PCL sequence for an Open Execute is as follows:&lt;br /&gt;
&lt;br /&gt;
* Reset&lt;br /&gt;
* Set Line Carriage mode (CR, CRLF, or LF)&lt;br /&gt;
* Set Orientation (Portrait or Landscape)&lt;br /&gt;
* Set Character Set (optional; not needed for US printing; may need to change for Spanish)&lt;br /&gt;
* Set Margins (optional; but you will probably need it at some point)&lt;br /&gt;
* Set Font&lt;br /&gt;
&lt;br /&gt;
When constructing a string, I recommend using *27 rather than $C(27) because it&#039;s shorter, and you will type a lot of it.&lt;br /&gt;
&lt;br /&gt;
An example. Note that this needs to be all in one string. It&#039;s separated here for education.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W *27,&amp;quot;E&amp;quot;    ; Reset&lt;br /&gt;
W *27,&amp;quot;&amp;amp;k2G&amp;quot; ; Set Carriage mode to LF.&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l0O&amp;quot; ; Portrait; Landscape is 1O.&lt;br /&gt;
...          ; Character Set Omitted&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l4E&amp;quot; ; Top Margin 4 lines&lt;br /&gt;
W *27,&amp;quot;&amp;amp;a5L&amp;quot; ; Left Margin 5 columns&lt;br /&gt;
W *27,&amp;quot;(s0p12h0s0b4099T&amp;quot; ; Fixed Pitch; 12 cpi, fixed pitch for secondary font, Medium Weight, select courier font.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Functions ==&lt;br /&gt;
I won&#039;t document this in detail, but here are some advanced examples. These ones do headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80-HD         RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p12h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5&lt;br /&gt;
L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h&lt;br /&gt;
0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot; S ($X,$&lt;br /&gt;
Y)=0                                    CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128-HD        RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p17h9v0s0b0T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;l7C&amp;quot;_$C(27&lt;br /&gt;
)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;#&amp;quot;,&amp;quot;&amp;quot;)                     PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(2&lt;br /&gt;
7),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,*27,&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&lt;br /&gt;
(s0p17h9v0s0b0T&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27,69)&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228-HD      RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p22h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p22h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132-HD       RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p14h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 46&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p14h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this one does a watermark:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-PORTRAIT-C16L7-WM            SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96&lt;br /&gt;
  FORM FEED: $c(27)_&amp;quot;*c5760x6000Y&amp;quot;_$c(27)_&amp;quot;*p150x150Y&amp;quot;_$c(27)_&amp;quot;*c0T&amp;quot;_$c(27)_&amp;quot;%1B&lt;br /&gt;
IN;SP1;DI1,-1;SD2,1,4,140,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;_$c&lt;br /&gt;
(3,27)_&amp;quot;%1A&amp;quot;_$c(12)                     PAGE LENGTH: 60&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;(8U&amp;quot;,*27,&amp;quot;(s0P&amp;quot;,*27,&amp;quot;(s16H&amp;quot;,*27,&amp;quot;(s9V&amp;quot;,*27,&amp;quot;(s0S&amp;quot;&lt;br /&gt;
,*27,&amp;quot;(s-3B&amp;quot;,*27,&amp;quot;(s0T&amp;quot;,*27,&amp;quot;&amp;amp;l88P&amp;quot;,*27,&amp;quot;&amp;amp;a255M&amp;quot;,*27,&amp;quot;&amp;amp;k2S&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot;,*27,&amp;quot;&amp;amp;s1C&lt;br /&gt;
&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W *27,&amp;quot;*c5760x6000Y&amp;quot;,*27,&amp;quot;*p150x150Y&amp;quot;,*27,&amp;quot;*c0T&amp;quot;,*27,&amp;quot;%1B&amp;quot;,&amp;quot;IN;&lt;br /&gt;
SP1;DI1,-1;SD1,21,2,1,4,140,5,0,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;&lt;br /&gt;
_$C(3),*27,&amp;quot;%1A&amp;quot;                     DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing PDFs from VISTA ==&lt;br /&gt;
Using GhostPCL, you can directly print out a PDF from VISTA. Here&#039;s an example in GT.M on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PDF WRITER                        $I: PDF-WRITER&lt;br /&gt;
  LOCATION OF TERMINAL: /tmp/           &lt;br /&gt;
  OPEN PARAMETERS: (comm=&amp;quot;pcl6 -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -SOutputFile=&lt;br /&gt;
/tmp/green-sheet.pdf -&amp;quot;)::&amp;quot;pipe&amp;quot;        SUBTYPE: P-HP BARCODER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, you can add a Windows printer that automatically calls GhostPCL. You need to use this amazing piece of software:&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/mfilemon/&lt;br /&gt;
&lt;br /&gt;
Once you install it and configure it, you need to set the $I appropriately.&lt;br /&gt;
&lt;br /&gt;
== Finding the TCP/IP address for a print queue name ==&lt;br /&gt;
On Linux, the lpstat command tells you details about the print queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -v&lt;br /&gt;
&lt;br /&gt;
device for TEST-01: socket://192.168.10.3:9100&lt;br /&gt;
&lt;br /&gt;
device for TEST-02: socket://192.168.10.4:9100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the ready status of a print queue ==&lt;br /&gt;
&lt;br /&gt;
On Linux, the lpstat command tells you all the printers and what their status is.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -a&lt;br /&gt;
&lt;br /&gt;
TEST-01 accepting requests since Sun 25 Dec 2005 09:54:34 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-02 accepting requests since Thu 28 Nov 2013 09:56:11 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-03 accepting requests since Fri 17 Mar 2017 10:03:00 AM EST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR for a particular printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -p  TEST-03&lt;br /&gt;
&lt;br /&gt;
printer TEST-03 is idle.  enabled since Fri 17 Mar 2017 08:39:00 AM EDT&lt;br /&gt;
        Ready to print.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17200</id>
		<title>VISTA Advanced printing topics</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17200"/>
		<updated>2016-10-24T22:02:48Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Various troubleshooting topics -- how fun! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Advanced Printing Topics =&lt;br /&gt;
Authored mainly by Sam Habiel, the printer &amp;quot;sensei.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How do computers communicate with printers, software-wise? ==&lt;br /&gt;
This is a pretty difficult topic. Cheaper printers only accept binary data that is hardcoded by the computers; typically these printers are only supported on Windows, and thus are named &amp;quot;Winprinters.&amp;quot; Higher end printers have a processor on them that can typically interpret PCL5, PCL6, and PS; and possibly PDF. These printers are easily supported in Linux. Commercial label printers (like Zebras) always accept their own programming language.&lt;br /&gt;
&lt;br /&gt;
== VISTA and what it really sends ==&lt;br /&gt;
VISTA sends PCL5 to laser printers; or a printer specific language for label printers--most commonly ZPL II for Zebra printers. For laser printers, you need to make sure that your printer supports PCL5. All HP Printers support PCL5, no matter how cheap; other manufacturers only support it on their higher end printers (not too high end--anything that isn&#039;t the cheapest printer may support PCL5). If you need to look it up, go to the manufacturer&#039;s website and look at the technical specs sheet. The section is typically called &amp;quot;supported emulations,&amp;quot; or &amp;quot;supported languages.&amp;quot; What VISTA sends is determined by the sub-type defined for the device.&lt;br /&gt;
&lt;br /&gt;
== Communicating with a printer on the network for the first time ==&lt;br /&gt;
Nothing prevents you from using a USB printer or even a parallel port printer, but in my experience, nobody uses those interfaces in production anymore.&lt;br /&gt;
&lt;br /&gt;
Get the IP address first. You can usually obtain that by printing an information sheet from the printer. Consult the printer manual to find out how to print that information sheet. You can also try to identify the printer from the list of connected hosts on your network.&lt;br /&gt;
&lt;br /&gt;
Whenever I set up a new printer, I tend to ensure that I can talk to it directly, with nothing in the middle. I use the netcat command (&#039;nc&#039;) to do that, connecting to the IP address of the printer on port 9100. Make sure to add the -v flag to netcat so that it can report whether it succeeded in connecting at all. It is very possible that you connected to a printer but you just don&#039;t know which one.&lt;br /&gt;
&lt;br /&gt;
(Aside: This can be done from VISTA using D CALL^%ZISTCP(ip_address,port,time_out)--but netcat is easier.)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of me trying to talk to a PCL printer, so it will print the word &amp;quot;test&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;TEST&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and here&#039;s an example printing a Datamatrix code on a Zebra printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;^XA^FO50,100^BXN,10,200^FDTESTTEST^FS^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A successful connection will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Connection to XX.XX.XX.XX 9100 port [tcp/jetdirect] succeeded!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An unsuccessful connection will either just hang or tell you connection refused.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nc: connect to XXXXXXXXX port 9100 (tcp) failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up the printer in the operating system ==&lt;br /&gt;
After confirming the connection, you need to set up the printer in the operating system. VISTA does NOT need any drivers for the printers to be installed.&lt;br /&gt;
&lt;br /&gt;
== Setting up a printer in VISTA ==&lt;br /&gt;
See [[Setting_up_a_VISTA_Printer|this page]].&lt;br /&gt;
&lt;br /&gt;
== Testing Printers ==&lt;br /&gt;
To test printers in VISTA after setting it up, there are a few steps you have to go through.&lt;br /&gt;
&lt;br /&gt;
If you run this on Caché, Caché steals your IO device between prompts. Therefore U IO to D ^%ZISC need to be on a single line. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U IO W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Invoke via %ZIS first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
D ^%ZIS&lt;br /&gt;
&lt;br /&gt;
DEVICE: HOME//MY PRINTER&lt;br /&gt;
&lt;br /&gt;
U IO&lt;br /&gt;
&lt;br /&gt;
W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the output. If it&#039;s okay, you are ready to move to the next step. If you see the &amp;quot;staircase&amp;quot; effect, you need to go back and set-up the terminal type correctly [[Setting_up_a_Linux_Printer|here]].&lt;br /&gt;
&lt;br /&gt;
The next menu option to try is Send Test Pattern to Terminal [XUTTEST]. If that works, then you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Various troubleshooting topics -- how fun! ==&lt;br /&gt;
There are various issues that come up regularly with VISTA.&lt;br /&gt;
&lt;br /&gt;
=== Laser Printer Issues ===&lt;br /&gt;
Use this page as a reference for PCL:&lt;br /&gt;
&lt;br /&gt;
http://www.pclviewer.com/resources/reference/&lt;br /&gt;
&lt;br /&gt;
==== Extra pages ====&lt;br /&gt;
Extra pages can happen for three different reasons:&lt;br /&gt;
 &lt;br /&gt;
* By default, VISTA prints an extra page after each print job. This is for historical reasons; as most of the early printers were dot-matrix. Today, it&#039;s recommended that this be disabled. To disable the extra page, you can do it at the device level or the terminal type level. At the device level, set &amp;lt;code&amp;gt;SUPPRESS FORM FEED AT CLOSE&amp;lt;/code&amp;gt; to yes. For the terminal type, set &amp;lt;code&amp;gt;CLOSE EXECUTE&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* The text doesn&#039;t fit the page and spills over to the next page. VISTA printing options must follow the IOSL value (Page Length in Terminal Type or Device--Device overrides Terminal Type). Most of the time this has to do with the fact that the text size for the report is too large; or that the margins are not appropriate. Based on visual inspection, you should decide what to do. The unlikely case is that the VISTA programmer is not obeying IOSL; but that is for you to determine.&lt;br /&gt;
* If both of the above fail, it&#039;s likely that VISTA sends a hard coded form feed to the printer. You need to capture the output by capturing the print to a file (use HFS;subtype) and visually examine it in a programming editor.&lt;br /&gt;
&lt;br /&gt;
==== Wrapping ====&lt;br /&gt;
Typically this has to do with whether the printer is configured to take 132 characters or 80 characters; if not, then it has to do with the font size.&lt;br /&gt;
&lt;br /&gt;
VISTA has these typical formats for printing:&lt;br /&gt;
&lt;br /&gt;
* 12 cpi 8 lpi Portrait (most reports)&lt;br /&gt;
* 17 cpi 7 lpi Portrait (MAR)&lt;br /&gt;
* 14 cpi 6 lpi Landscape (132 wide reports)&lt;br /&gt;
* 22 cpi 12 lpi Landscape (228 wide reports)&lt;br /&gt;
&lt;br /&gt;
==== Only a single line prints ====&lt;br /&gt;
You are seeing the staircase effect. See the Staircase section in [[Setting_up_a_VISTA_Printer]].&lt;br /&gt;
&lt;br /&gt;
=== Zebra Printer Issues ===&lt;br /&gt;
From my memory, these are typically the issues you face:&lt;br /&gt;
&lt;br /&gt;
* Label not aligned vertically&lt;br /&gt;
* Label not aligned horizontally&lt;br /&gt;
* Labels are not dark enough.&lt;br /&gt;
* Label gets cut off&lt;br /&gt;
* VISTA printed labels are too small&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned vertically ====&lt;br /&gt;
Zebras mostly auto calibrate printing on continuous media. Check your Zebra&#039;s manual on how to do that for the specific model.&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned horizontally ====&lt;br /&gt;
Zebras don&#039;t auto align to the width. You have to set the print width yourself. They can detect the start of the label though.&lt;br /&gt;
&lt;br /&gt;
To do that, find your printer dpi setting, and multiply that by the width of your label. E.g. 202 dpi with 3.5&amp;quot;, you need to run this command from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA^PW707^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn&#039;t solve your problem, you need to look carefully at the actual feeding of the label into the zebra printer. Read the manual carefully. I have seen many people &amp;quot;wing it&amp;quot; and do it incorrectly. I have even seen a printer where the left margin guide wasn&#039;t used and a rubber band was placed there. After you turn off or restart the printer, it tries to self calibrate.&lt;br /&gt;
&lt;br /&gt;
==== Label Text is not dark enough ====&lt;br /&gt;
There are two tunable circle things on the top of the print head that can be turned to increase the darkness. Try that. There is also a Zebra setting that can be changed to increase the darkness.&lt;br /&gt;
&lt;br /&gt;
==== Label gets cut off ====&lt;br /&gt;
If the label gets cut off on the right hand side of the label, check your print width (see &#039;Label not aligned horizontally&#039;), and if that&#039;s not the issue, check the position of the ribbon vis a vis the labels. The printer may be trying to print, but there is no ribbon at the place it&#039;s trying to print. If it is getting cut off from the left side, check that your labels are using the left hand guide and are not colliding with it. If it is getting cut off vertically, you need to calibrate the printer. If it still gets cut off, you need to capture the ZPL II that is sent by VISTA and see 1. that it&#039;s formatted correctly and 2. that there isn&#039;t too much information to print.&lt;br /&gt;
&lt;br /&gt;
==== VISTA printed labels are too small ====&lt;br /&gt;
This means that you bought a Zebra printer with the wrong dpi. You have to return it and buy another one. VISTA wants printers with 202 DPI. If you want to use the new printer, you need to re-write some of the label code.&lt;br /&gt;
&lt;br /&gt;
=== Advanced troubleshooting ===&lt;br /&gt;
If you are stuck with a particularly difficult problem, it may be useful to capture the PCL and use a PCL emulator and print to a PDF; or ZPL II and use a Zebra emulator.&lt;br /&gt;
&lt;br /&gt;
To capture an output from VISTA, you need to create a device whose type is HFS but whose destination is pre-determined. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM-DIRECT-HFS-PRINTER            $I: /tmp/op-dev6-lbl-sam.pcl&lt;br /&gt;
  LOCATION OF TERMINAL: File&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;NWS&amp;quot;                SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: HOST FILE SERVER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to change the file for each job, so that they won&#039;t overwrite each other, you can append something to IO in the pre-open execute. Please note that you need to change &amp;quot;NWS&amp;quot; to (newversion) on GT.M.&lt;br /&gt;
&lt;br /&gt;
This is the emulator I use for PCL, http://www.ghostscript.com/GhostPCL.html.&lt;br /&gt;
This is the emulator I use for ZPL II, http://labelary.com/viewer.html&lt;br /&gt;
&lt;br /&gt;
To use GhostPCL, here is a sample invocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat vista_print-0001.pcl | C:\Users\shabiel\workspace\ghostpcl-9.15-win32\pcl6-9.15-win32.exe -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -r600 -sOutputFile=&amp;quot;testpdf.sam&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical PCL String ==&lt;br /&gt;
To construct a PCL in VISTA, you typically put everything in the Open Execute. The Close Execute should always be set to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt; unless you want to do something special. The Form Feed accepts PCL as well.&lt;br /&gt;
&lt;br /&gt;
The typical PCL sequence for an Open Execute is as follows:&lt;br /&gt;
&lt;br /&gt;
* Reset&lt;br /&gt;
* Set Line Carriage mode (CR, CRLF, or LF)&lt;br /&gt;
* Set Orientation (Portrait or Landscape)&lt;br /&gt;
* Set Character Set (optional; not needed for US printing; may need to Spanish)&lt;br /&gt;
* Set Margins (optional; but you will probably need it at some point)&lt;br /&gt;
* Set Font&lt;br /&gt;
&lt;br /&gt;
When constructing a string, I recommend using *27 rather than $C(27) because it&#039;s shorter, and you will type a lot of it.&lt;br /&gt;
&lt;br /&gt;
An example. Note that this needs to be all in one string. It&#039;s separated here for education.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W *27,&amp;quot;E&amp;quot;    ; Reset&lt;br /&gt;
W *27,&amp;quot;&amp;amp;k2G&amp;quot; ; Set Carriage mode to LF.&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l0O&amp;quot; ; Portrait; Landscape is 1O.&lt;br /&gt;
...          ; Character Set Omitted&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l4E&amp;quot; ; Top Margin 4 lines&lt;br /&gt;
W *27,&amp;quot;&amp;amp;a5L&amp;quot; ; Left Martin 5 columns&lt;br /&gt;
W *27,&amp;quot;(s0p12h0s0b4099T&amp;quot; ; Fixed Pitch; 12 cpi, fixed pitch for secondary font, Medium Weight, select courier font.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Functions ==&lt;br /&gt;
I won&#039;t document this in detail, but here are some advanced examples. These ones do headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80-HD         RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p12h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5&lt;br /&gt;
L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h&lt;br /&gt;
0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot; S ($X,$&lt;br /&gt;
Y)=0                                    CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128-HD        RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p17h9v0s0b0T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;l7C&amp;quot;_$C(27&lt;br /&gt;
)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;#&amp;quot;,&amp;quot;&amp;quot;)                     PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(2&lt;br /&gt;
7),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,*27,&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&lt;br /&gt;
(s0p17h9v0s0b0T&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27,69)&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228-HD      RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p22h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p22h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132-HD       RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p14h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 46&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p14h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this one does a watermark:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-PORTRAIT-C16L7-WM            SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96&lt;br /&gt;
  FORM FEED: $c(27)_&amp;quot;*c5760x6000Y&amp;quot;_$c(27)_&amp;quot;*p150x150Y&amp;quot;_$c(27)_&amp;quot;*c0T&amp;quot;_$c(27)_&amp;quot;%1B&lt;br /&gt;
IN;SP1;DI1,-1;SD2,1,4,140,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;_$c&lt;br /&gt;
(3,27)_&amp;quot;%1A&amp;quot;_$c(12)                     PAGE LENGTH: 60&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;(8U&amp;quot;,*27,&amp;quot;(s0P&amp;quot;,*27,&amp;quot;(s16H&amp;quot;,*27,&amp;quot;(s9V&amp;quot;,*27,&amp;quot;(s0S&amp;quot;&lt;br /&gt;
,*27,&amp;quot;(s-3B&amp;quot;,*27,&amp;quot;(s0T&amp;quot;,*27,&amp;quot;&amp;amp;l88P&amp;quot;,*27,&amp;quot;&amp;amp;a255M&amp;quot;,*27,&amp;quot;&amp;amp;k2S&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot;,*27,&amp;quot;&amp;amp;s1C&lt;br /&gt;
&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W *27,&amp;quot;*c5760x6000Y&amp;quot;,*27,&amp;quot;*p150x150Y&amp;quot;,*27,&amp;quot;*c0T&amp;quot;,*27,&amp;quot;%1B&amp;quot;,&amp;quot;IN;&lt;br /&gt;
SP1;DI1,-1;SD1,21,2,1,4,140,5,0,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;&lt;br /&gt;
_$C(3),*27,&amp;quot;%1A&amp;quot;                     DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing PDFs from VISTA ==&lt;br /&gt;
Using GhostPCL, you can directly print out a PDF from VISTA. Here&#039;s an example in GT.M on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PDF WRITER                        $I: PDF-WRITER&lt;br /&gt;
  LOCATION OF TERMINAL: /tmp/           &lt;br /&gt;
  OPEN PARAMETERS: (comm=&amp;quot;pcl6 -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -SOutputFile=&lt;br /&gt;
/tmp/green-sheet.pdf -&amp;quot;)::&amp;quot;pipe&amp;quot;        SUBTYPE: P-HP BARCODER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, you can add a Windows printer that automatically calls GhostPCL. You need to use this amazing piece of software:&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/mfilemon/&lt;br /&gt;
&lt;br /&gt;
Once you install it and configure it, you need to set the $I appropriately.&lt;br /&gt;
&lt;br /&gt;
== Finding the TCP/IP address for a print queue name ==&lt;br /&gt;
On Linux, the lpstat command tells you details about the print queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -v&lt;br /&gt;
&lt;br /&gt;
device for TEST-01: socket://192.168.10.3:9100&lt;br /&gt;
&lt;br /&gt;
device for TEST-02: socket://192.168.10.4:9100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the ready status of a print queue ==&lt;br /&gt;
&lt;br /&gt;
On Linux, the lpstat command tells you all the printers and what their status is.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -a&lt;br /&gt;
&lt;br /&gt;
TEST-01 accepting requests since Sun 25 Dec 2005 09:54:34 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-02 accepting requests since Thu 28 Nov 2013 09:56:11 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-03 accepting requests since Fri 17 Mar 2017 10:03:00 AM EST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR for a particular printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -p  TEST-03&lt;br /&gt;
&lt;br /&gt;
printer TEST-03 is idle.  enabled since Fri 17 Mar 2017 08:39:00 AM EDT&lt;br /&gt;
        Ready to print.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17199</id>
		<title>VISTA Advanced printing topics</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17199"/>
		<updated>2016-10-24T21:47:36Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Testing Printers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Advanced Printing Topics =&lt;br /&gt;
Authored mainly by Sam Habiel, the printer &amp;quot;sensei.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How do computers communicate with printers, software-wise? ==&lt;br /&gt;
This is a pretty difficult topic. Cheaper printers only accept binary data that is hardcoded by the computers; typically these printers are only supported on Windows, and thus are named &amp;quot;Winprinters.&amp;quot; Higher end printers have a processor on them that can typically interpret PCL5, PCL6, and PS; and possibly PDF. These printers are easily supported in Linux. Commercial label printers (like Zebras) always accept their own programming language.&lt;br /&gt;
&lt;br /&gt;
== VISTA and what it really sends ==&lt;br /&gt;
VISTA sends PCL5 to laser printers; or a printer specific language for label printers--most commonly ZPL II for Zebra printers. For laser printers, you need to make sure that your printer supports PCL5. All HP Printers support PCL5, no matter how cheap; other manufacturers only support it on their higher end printers (not too high end--anything that isn&#039;t the cheapest printer may support PCL5). If you need to look it up, go to the manufacturer&#039;s website and look at the technical specs sheet. The section is typically called &amp;quot;supported emulations,&amp;quot; or &amp;quot;supported languages.&amp;quot; What VISTA sends is determined by the sub-type defined for the device.&lt;br /&gt;
&lt;br /&gt;
== Communicating with a printer on the network for the first time ==&lt;br /&gt;
Nothing prevents you from using a USB printer or even a parallel port printer, but in my experience, nobody uses those interfaces in production anymore.&lt;br /&gt;
&lt;br /&gt;
Get the IP address first. You can usually obtain that by printing an information sheet from the printer. Consult the printer manual to find out how to print that information sheet. You can also try to identify the printer from the list of connected hosts on your network.&lt;br /&gt;
&lt;br /&gt;
Whenever I set up a new printer, I tend to ensure that I can talk to it directly, with nothing in the middle. I use the netcat command (&#039;nc&#039;) to do that, connecting to the IP address of the printer on port 9100. Make sure to add the -v flag to netcat so that it can report whether it succeeded in connecting at all. It is very possible that you connected to a printer but you just don&#039;t know which one.&lt;br /&gt;
&lt;br /&gt;
(Aside: This can be done from VISTA using D CALL^%ZISTCP(ip_address,port,time_out)--but netcat is easier.)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of me trying to talk to a PCL printer, so it will print the word &amp;quot;test&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;TEST&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and here&#039;s an example printing a Datamatrix code on a Zebra printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;^XA^FO50,100^BXN,10,200^FDTESTTEST^FS^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A successful connection will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Connection to XX.XX.XX.XX 9100 port [tcp/jetdirect] succeeded!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An unsuccessful connection will either just hang or tell you connection refused.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nc: connect to XXXXXXXXX port 9100 (tcp) failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up the printer in the operating system ==&lt;br /&gt;
After confirming the connection, you need to set up the printer in the operating system. VISTA does NOT need any drivers for the printers to be installed.&lt;br /&gt;
&lt;br /&gt;
== Setting up a printer in VISTA ==&lt;br /&gt;
See [[Setting_up_a_VISTA_Printer|this page]].&lt;br /&gt;
&lt;br /&gt;
== Testing Printers ==&lt;br /&gt;
To test printers in VISTA after setting it up, there are a few steps you have to go through.&lt;br /&gt;
&lt;br /&gt;
If you run this on Caché, Caché steals your IO device between prompts. Therefore U IO to D ^%ZISC need to be on a single line. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U IO W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Invoke via %ZIS first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
D ^%ZIS&lt;br /&gt;
&lt;br /&gt;
DEVICE: HOME//MY PRINTER&lt;br /&gt;
&lt;br /&gt;
U IO&lt;br /&gt;
&lt;br /&gt;
W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the output. If it&#039;s okay, you are ready to move to the next step. If you see the &amp;quot;staircase&amp;quot; effect, you need to go back and set-up the terminal type correctly [[Setting_up_a_Linux_Printer|here]].&lt;br /&gt;
&lt;br /&gt;
The next menu option to try is Send Test Pattern to Terminal [XUTTEST]. If that works, then you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Various troubleshooting topics -- how fun! ==&lt;br /&gt;
There are various issue that come up regularly with VISTA.&lt;br /&gt;
&lt;br /&gt;
=== Laser Printer Issues ===&lt;br /&gt;
Use this page as a reference for PCL:&lt;br /&gt;
&lt;br /&gt;
http://www.pclviewer.com/resources/reference/&lt;br /&gt;
&lt;br /&gt;
==== Extra pages ====&lt;br /&gt;
Extra pages can happen for three different reasons:&lt;br /&gt;
 &lt;br /&gt;
* By default, VISTA prints an extra page after each print job. This is for historical reasons; as most of the early printers were dot-matrix. Today, it&#039;s recommended to disable this. To disable this, you can do it at the device level or the terminal type level. At the device level, set &amp;lt;code&amp;gt;SUPPRESS FORM FEED AT CLOSE&amp;lt;/code&amp;gt; to yes. For the terminal type, set &amp;lt;code&amp;gt;CLOSE EXECUTE&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* The text doesn&#039;t fit the page and spills over to the next page. VISTA printing options must follow the IOSL value (Page Length in Terminal Type or Device--Device overrides Terminal Type). Most of the time this has to do with the fact that the text size for the report is too large; or that the margins are not appropriate. Based on visual inspection, you should decide what to do. The unlikely case is that the VISTA programmer is not obeying IOSL; but that is for you to determine.&lt;br /&gt;
* If both of the above fail, it&#039;s likely that VISTA sends a hard coded form feed to the printer. You need to capture the output by capturing the print to a file (use HFS;subtype) and visually examine it in a programming editor.&lt;br /&gt;
&lt;br /&gt;
==== Wrapping ====&lt;br /&gt;
Typically this has to do with whether the printer is configured to take 132 characters or 80 characters; if not, then it has to do with the font size.&lt;br /&gt;
&lt;br /&gt;
VISTA has these typical formats for printing:&lt;br /&gt;
&lt;br /&gt;
* 12 cpi 8 lpi Portrait (most reports)&lt;br /&gt;
* 17 cpi 7 lpi Portrait (MAR)&lt;br /&gt;
* 14 cpi 6 lpi Landscape (132 wide reports)&lt;br /&gt;
* 22 cpi 12 lpi Landscape (228 wide reports)&lt;br /&gt;
&lt;br /&gt;
==== Only a single line prints ====&lt;br /&gt;
You are seeing the staircase effect. See the Staircase section in [[Setting_up_a_VISTA_Printer]].&lt;br /&gt;
&lt;br /&gt;
=== Zebra Printer Issues ===&lt;br /&gt;
From my memory, these are typically the issues you face:&lt;br /&gt;
&lt;br /&gt;
* Label not aligned vertically&lt;br /&gt;
* Label not aligned horizontally&lt;br /&gt;
* Labels are not dark enough.&lt;br /&gt;
* Label gets cut off&lt;br /&gt;
* VISTA printed labels are too small&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned vertically ====&lt;br /&gt;
Zebras mostly auto calibrate printing on continuous media. Check your Zebra&#039;s manual on how to do that for the specific model.&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned horizontally ====&lt;br /&gt;
Zebras don&#039;t auto align to the width. You have to set the print width yourself. They can detect the start of the label though.&lt;br /&gt;
&lt;br /&gt;
To do that, find your printer dpi setting, and multiply that by the width of your label. E.g. 202 dpi with 3.5&amp;quot;, you need to run this command from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA^PW707^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn&#039;t solve your problem, you need to look carefully at the actual feeding of the label into the zebra printer. Read the manual carefully. I have seen many people &amp;quot;wing it&amp;quot; and do it incorrectly. I have even seen a printer where the left margin guide wasn&#039;t used and a rubber band was placed there. After you turn off the restart the printer, it tries to self calibrate.&lt;br /&gt;
&lt;br /&gt;
==== Label Text is not dark enough ====&lt;br /&gt;
There are two tunable circle things on the top of the print head that can be turned to increase the darkness. Try that. There is also a Zebra setting that can be changed to increase the darkness.&lt;br /&gt;
&lt;br /&gt;
==== Label gets cut off ====&lt;br /&gt;
If the label gets cut off on the right hand side of the label, check your print width (see &#039;Label not aligned horizontally&#039;), and if that&#039;s not the issue, check the position of the ribbon vis a vis the labels. The printer may be trying to print, but there is no ribbon at the place it&#039;s trying to print. If it is getting cut off from the left side, check that your labels are using the left hand guide and are not colliding with it. If it is getting cut off vertically, you need to calibrate the printer. If it still gets cut off, you need to capture the ZPL II that is sent by VISTA and see 1. that it&#039;s formatted correctly and 2. that there isn&#039;t too much information to print.&lt;br /&gt;
&lt;br /&gt;
==== VISTA printed labels are too small ====&lt;br /&gt;
This means that you bought a Zebra printer with the wrong dpi. You have to return it and buy another one. VISTA wants printers with 202 DPI. If you want to use the new printer, you need to re-write some of the label code.&lt;br /&gt;
&lt;br /&gt;
=== Advanced troubleshooting ===&lt;br /&gt;
If you are stuck with a particularly difficult problem, it may be useful to capture the PCL and use a PCL emulator and print to a PDF; or ZPL II and use a Zebra emulator.&lt;br /&gt;
&lt;br /&gt;
To capture an output from VISTA, you need to create a device whose type is HFS but whose destination is pre-determined. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM-DIRECT-HFS-PRINTER            $I: /tmp/op-dev6-lbl-sam.pcl&lt;br /&gt;
  LOCATION OF TERMINAL: File&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;NWS&amp;quot;                SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: HOST FILE SERVER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to change the file for each job, so that they won&#039;t overwrite each other, you can append something to IO in the pre-open execute. Please note that you need to change &amp;quot;NWS&amp;quot; to (newversion) on GT.M.&lt;br /&gt;
&lt;br /&gt;
This is the emulator I use for PCL, http://www.ghostscript.com/GhostPCL.html.&lt;br /&gt;
This is the emulator I use for ZPL II, http://labelary.com/viewer.html&lt;br /&gt;
&lt;br /&gt;
To use GhostPCL, here is a sample invocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat vista_print-0001.pcl | C:\Users\shabiel\workspace\ghostpcl-9.15-win32\pcl6-9.15-win32.exe -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -r600 -sOutputFile=&amp;quot;testpdf.sam&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical PCL String ==&lt;br /&gt;
To construct a PCL in VISTA, you typically put everything in the Open Execute. The Close Execute should always be set to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt; unless you want to do something special. The Form Feed accepts PCL as well.&lt;br /&gt;
&lt;br /&gt;
The typical PCL sequence for an Open Execute is as follows:&lt;br /&gt;
&lt;br /&gt;
* Reset&lt;br /&gt;
* Set Line Carriage mode (CR, CRLF, or LF)&lt;br /&gt;
* Set Orientation (Portrait or Landscape)&lt;br /&gt;
* Set Character Set (optional; not needed for US printing; may need to Spanish)&lt;br /&gt;
* Set Margins (optional; but you will probably need it at some point)&lt;br /&gt;
* Set Font&lt;br /&gt;
&lt;br /&gt;
When constructing a string, I recommend using *27 rather than $C(27) because it&#039;s shorter, and you will type a lot of it.&lt;br /&gt;
&lt;br /&gt;
An example. Note that this needs to be all in one string. It&#039;s separated here for education.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W *27,&amp;quot;E&amp;quot;    ; Reset&lt;br /&gt;
W *27,&amp;quot;&amp;amp;k2G&amp;quot; ; Set Carriage mode to LF.&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l0O&amp;quot; ; Portrait; Landscape is 1O.&lt;br /&gt;
...          ; Character Set Omitted&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l4E&amp;quot; ; Top Margin 4 lines&lt;br /&gt;
W *27,&amp;quot;&amp;amp;a5L&amp;quot; ; Left Martin 5 columns&lt;br /&gt;
W *27,&amp;quot;(s0p12h0s0b4099T&amp;quot; ; Fixed Pitch; 12 cpi, fixed pitch for secondary font, Medium Weight, select courier font.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Functions ==&lt;br /&gt;
I won&#039;t document this in detail, but here are some advanced examples. These ones do headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80-HD         RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p12h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5&lt;br /&gt;
L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h&lt;br /&gt;
0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot; S ($X,$&lt;br /&gt;
Y)=0                                    CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128-HD        RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p17h9v0s0b0T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;l7C&amp;quot;_$C(27&lt;br /&gt;
)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;#&amp;quot;,&amp;quot;&amp;quot;)                     PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(2&lt;br /&gt;
7),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,*27,&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&lt;br /&gt;
(s0p17h9v0s0b0T&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27,69)&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228-HD      RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p22h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p22h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132-HD       RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p14h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 46&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p14h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this one does a watermark:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-PORTRAIT-C16L7-WM            SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96&lt;br /&gt;
  FORM FEED: $c(27)_&amp;quot;*c5760x6000Y&amp;quot;_$c(27)_&amp;quot;*p150x150Y&amp;quot;_$c(27)_&amp;quot;*c0T&amp;quot;_$c(27)_&amp;quot;%1B&lt;br /&gt;
IN;SP1;DI1,-1;SD2,1,4,140,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;_$c&lt;br /&gt;
(3,27)_&amp;quot;%1A&amp;quot;_$c(12)                     PAGE LENGTH: 60&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;(8U&amp;quot;,*27,&amp;quot;(s0P&amp;quot;,*27,&amp;quot;(s16H&amp;quot;,*27,&amp;quot;(s9V&amp;quot;,*27,&amp;quot;(s0S&amp;quot;&lt;br /&gt;
,*27,&amp;quot;(s-3B&amp;quot;,*27,&amp;quot;(s0T&amp;quot;,*27,&amp;quot;&amp;amp;l88P&amp;quot;,*27,&amp;quot;&amp;amp;a255M&amp;quot;,*27,&amp;quot;&amp;amp;k2S&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot;,*27,&amp;quot;&amp;amp;s1C&lt;br /&gt;
&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W *27,&amp;quot;*c5760x6000Y&amp;quot;,*27,&amp;quot;*p150x150Y&amp;quot;,*27,&amp;quot;*c0T&amp;quot;,*27,&amp;quot;%1B&amp;quot;,&amp;quot;IN;&lt;br /&gt;
SP1;DI1,-1;SD1,21,2,1,4,140,5,0,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;&lt;br /&gt;
_$C(3),*27,&amp;quot;%1A&amp;quot;                     DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing PDFs from VISTA ==&lt;br /&gt;
Using GhostPCL, you can directly print out a PDF from VISTA. Here&#039;s an example in GT.M on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PDF WRITER                        $I: PDF-WRITER&lt;br /&gt;
  LOCATION OF TERMINAL: /tmp/           &lt;br /&gt;
  OPEN PARAMETERS: (comm=&amp;quot;pcl6 -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -SOutputFile=&lt;br /&gt;
/tmp/green-sheet.pdf -&amp;quot;)::&amp;quot;pipe&amp;quot;        SUBTYPE: P-HP BARCODER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, you can add a Windows printer that automatically calls GhostPCL. You need to use this amazing piece of software:&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/mfilemon/&lt;br /&gt;
&lt;br /&gt;
Once you install it and configure it, you need to set the $I appropriately.&lt;br /&gt;
&lt;br /&gt;
== Finding the TCP/IP address for a print queue name ==&lt;br /&gt;
On Linux, the lpstat command tells you details about the print queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -v&lt;br /&gt;
&lt;br /&gt;
device for TEST-01: socket://192.168.10.3:9100&lt;br /&gt;
&lt;br /&gt;
device for TEST-02: socket://192.168.10.4:9100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the ready status of a print queue ==&lt;br /&gt;
&lt;br /&gt;
On Linux, the lpstat command tells you all the printers and what their status is.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -a&lt;br /&gt;
&lt;br /&gt;
TEST-01 accepting requests since Sun 25 Dec 2005 09:54:34 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-02 accepting requests since Thu 28 Nov 2013 09:56:11 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-03 accepting requests since Fri 17 Mar 2017 10:03:00 AM EST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR for a particular printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -p  TEST-03&lt;br /&gt;
&lt;br /&gt;
printer TEST-03 is idle.  enabled since Fri 17 Mar 2017 08:39:00 AM EDT&lt;br /&gt;
        Ready to print.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17198</id>
		<title>VISTA Advanced printing topics</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17198"/>
		<updated>2016-10-24T21:39:46Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Setting up the printer in the operating system */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Advanced Printing Topics =&lt;br /&gt;
Authored mainly by Sam Habiel, the printer &amp;quot;sensei.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How do computers communicate with printers, software-wise? ==&lt;br /&gt;
This is a pretty difficult topic. Cheaper printers only accept binary data that is hardcoded by the computers; typically these printers are only supported on Windows, and thus are named &amp;quot;Winprinters.&amp;quot; Higher end printers have a processor on them that can typically interpret PCL5, PCL6, and PS; and possibly PDF. These printers are easily supported in Linux. Commercial label printers (like Zebras) always accept their own programming language.&lt;br /&gt;
&lt;br /&gt;
== VISTA and what it really sends ==&lt;br /&gt;
VISTA sends PCL5 to laser printers; or a printer specific language for label printers--most commonly ZPL II for Zebra printers. For laser printers, you need to make sure that your printer supports PCL5. All HP Printers support PCL5, no matter how cheap; other manufacturers only support it on their higher end printers (not too high end--anything that isn&#039;t the cheapest printer may support PCL5). If you need to look it up, go to the manufacturer&#039;s website and look at the technical specs sheet. The section is typically called &amp;quot;supported emulations,&amp;quot; or &amp;quot;supported languages.&amp;quot; What VISTA sends is determined by the sub-type defined for the device.&lt;br /&gt;
&lt;br /&gt;
== Communicating with a printer on the network for the first time ==&lt;br /&gt;
Nothing prevents you from using a USB printer or even a parallel port printer, but in my experience, nobody uses those interfaces in production anymore.&lt;br /&gt;
&lt;br /&gt;
Get the IP address first. You can usually obtain that by printing an information sheet from the printer. Consult the printer manual to find out how to print that information sheet. You can also try to identify the printer from the list of connected hosts on your network.&lt;br /&gt;
&lt;br /&gt;
Whenever I set up a new printer, I tend to ensure that I can talk to it directly, with nothing in the middle. I use the netcat command (&#039;nc&#039;) to do that, connecting to the IP address of the printer on port 9100. Make sure to add the -v flag to netcat so that it can report whether it succeeded in connecting at all. It is very possible that you connected to a printer but you just don&#039;t know which one.&lt;br /&gt;
&lt;br /&gt;
(Aside: This can be done from VISTA using D CALL^%ZISTCP(ip_address,port,time_out)--but netcat is easier.)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of me trying to talk to a PCL printer, so it will print the word &amp;quot;test&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;TEST&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and here&#039;s an example printing a Datamatrix code on a Zebra printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;^XA^FO50,100^BXN,10,200^FDTESTTEST^FS^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A successful connection will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Connection to XX.XX.XX.XX 9100 port [tcp/jetdirect] succeeded!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An unsuccessful connection will either just hang or tell you connection refused.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nc: connect to XXXXXXXXX port 9100 (tcp) failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up the printer in the operating system ==&lt;br /&gt;
After confirming the connection, you need to set up the printer in the operating system. VISTA does NOT need any drivers for the printers to be installed.&lt;br /&gt;
&lt;br /&gt;
== Setting up a printer in VISTA ==&lt;br /&gt;
See [[Setting_up_a_VISTA_Printer|this page]].&lt;br /&gt;
&lt;br /&gt;
== Testing Printers ==&lt;br /&gt;
To test printers in VISTA after setting it up, there are a few steps you have to go through.&lt;br /&gt;
&lt;br /&gt;
If you run this on Cache, Cache steals your IO device between prompts. Therefore U IO to D ^%ZISC need to be on a single line.&lt;br /&gt;
&lt;br /&gt;
Invoke via %ZIS first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
D ^%ZIS&lt;br /&gt;
&lt;br /&gt;
DEVICE: HOME//MY PRINTER&lt;br /&gt;
&lt;br /&gt;
U IO&lt;br /&gt;
&lt;br /&gt;
W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the output. If it&#039;s okay, you are ready to move to the next step. If you see the &amp;quot;staircase&amp;quot; effect, you need to go back and set-up the terminal type correctly [[Setting_up_a_Linux_Printer|here]].&lt;br /&gt;
&lt;br /&gt;
The next menu option to try is Send Test Pattern to Terminal [XUTTEST]. If that works, then you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Various troubleshooting topics -- how fun! ==&lt;br /&gt;
There are various issue that come up regularly with VISTA.&lt;br /&gt;
&lt;br /&gt;
=== Laser Printer Issues ===&lt;br /&gt;
Use this page as a reference for PCL:&lt;br /&gt;
&lt;br /&gt;
http://www.pclviewer.com/resources/reference/&lt;br /&gt;
&lt;br /&gt;
==== Extra pages ====&lt;br /&gt;
Extra pages can happen for three different reasons:&lt;br /&gt;
 &lt;br /&gt;
* By default, VISTA prints an extra page after each print job. This is for historical reasons; as most of the early printers were dot-matrix. Today, it&#039;s recommended to disable this. To disable this, you can do it at the device level or the terminal type level. At the device level, set &amp;lt;code&amp;gt;SUPPRESS FORM FEED AT CLOSE&amp;lt;/code&amp;gt; to yes. For the terminal type, set &amp;lt;code&amp;gt;CLOSE EXECUTE&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* The text doesn&#039;t fit the page and spills over to the next page. VISTA printing options must follow the IOSL value (Page Length in Terminal Type or Device--Device overrides Terminal Type). Most of the time this has to do with the fact that the text size for the report is too large; or that the margins are not appropriate. Based on visual inspection, you should decide what to do. The unlikely case is that the VISTA programmer is not obeying IOSL; but that is for you to determine.&lt;br /&gt;
* If both of the above fail, it&#039;s likely that VISTA sends a hard coded form feed to the printer. You need to capture the output by capturing the print to a file (use HFS;subtype) and visually examine it in a programming editor.&lt;br /&gt;
&lt;br /&gt;
==== Wrapping ====&lt;br /&gt;
Typically this has to do with whether the printer is configured to take 132 characters or 80 characters; if not, then it has to do with the font size.&lt;br /&gt;
&lt;br /&gt;
VISTA has these typical formats for printing:&lt;br /&gt;
&lt;br /&gt;
* 12 cpi 8 lpi Portrait (most reports)&lt;br /&gt;
* 17 cpi 7 lpi Portrait (MAR)&lt;br /&gt;
* 14 cpi 6 lpi Landscape (132 wide reports)&lt;br /&gt;
* 22 cpi 12 lpi Landscape (228 wide reports)&lt;br /&gt;
&lt;br /&gt;
==== Only a single line prints ====&lt;br /&gt;
You are seeing the staircase effect. See the Staircase section in [[Setting_up_a_VISTA_Printer]].&lt;br /&gt;
&lt;br /&gt;
=== Zebra Printer Issues ===&lt;br /&gt;
From my memory, these are typically the issues you face:&lt;br /&gt;
&lt;br /&gt;
* Label not aligned vertically&lt;br /&gt;
* Label not aligned horizontally&lt;br /&gt;
* Labels are not dark enough.&lt;br /&gt;
* Label gets cut off&lt;br /&gt;
* VISTA printed labels are too small&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned vertically ====&lt;br /&gt;
Zebras mostly auto calibrate printing on continuous media. Check your Zebra&#039;s manual on how to do that for the specific model.&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned horizontally ====&lt;br /&gt;
Zebras don&#039;t auto align to the width. You have to set the print width yourself. They can detect the start of the label though.&lt;br /&gt;
&lt;br /&gt;
To do that, find your printer dpi setting, and multiply that by the width of your label. E.g. 202 dpi with 3.5&amp;quot;, you need to run this command from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA^PW707^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn&#039;t solve your problem, you need to look carefully at the actual feeding of the label into the zebra printer. Read the manual carefully. I have seen many people &amp;quot;wing it&amp;quot; and do it incorrectly. I have even seen a printer where the left margin guide wasn&#039;t used and a rubber band was placed there. After you turn off the restart the printer, it tries to self calibrate.&lt;br /&gt;
&lt;br /&gt;
==== Label Text is not dark enough ====&lt;br /&gt;
There are two tunable circle things on the top of the print head that can be turned to increase the darkness. Try that. There is also a Zebra setting that can be changed to increase the darkness.&lt;br /&gt;
&lt;br /&gt;
==== Label gets cut off ====&lt;br /&gt;
If the label gets cut off on the right hand side of the label, check your print width (see &#039;Label not aligned horizontally&#039;), and if that&#039;s not the issue, check the position of the ribbon vis a vis the labels. The printer may be trying to print, but there is no ribbon at the place it&#039;s trying to print. If it is getting cut off from the left side, check that your labels are using the left hand guide and are not colliding with it. If it is getting cut off vertically, you need to calibrate the printer. If it still gets cut off, you need to capture the ZPL II that is sent by VISTA and see 1. that it&#039;s formatted correctly and 2. that there isn&#039;t too much information to print.&lt;br /&gt;
&lt;br /&gt;
==== VISTA printed labels are too small ====&lt;br /&gt;
This means that you bought a Zebra printer with the wrong dpi. You have to return it and buy another one. VISTA wants printers with 202 DPI. If you want to use the new printer, you need to re-write some of the label code.&lt;br /&gt;
&lt;br /&gt;
=== Advanced troubleshooting ===&lt;br /&gt;
If you are stuck with a particularly difficult problem, it may be useful to capture the PCL and use a PCL emulator and print to a PDF; or ZPL II and use a Zebra emulator.&lt;br /&gt;
&lt;br /&gt;
To capture an output from VISTA, you need to create a device whose type is HFS but whose destination is pre-determined. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM-DIRECT-HFS-PRINTER            $I: /tmp/op-dev6-lbl-sam.pcl&lt;br /&gt;
  LOCATION OF TERMINAL: File&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;NWS&amp;quot;                SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: HOST FILE SERVER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to change the file for each job, so that they won&#039;t overwrite each other, you can append something to IO in the pre-open execute. Please note that you need to change &amp;quot;NWS&amp;quot; to (newversion) on GT.M.&lt;br /&gt;
&lt;br /&gt;
This is the emulator I use for PCL, http://www.ghostscript.com/GhostPCL.html.&lt;br /&gt;
This is the emulator I use for ZPL II, http://labelary.com/viewer.html&lt;br /&gt;
&lt;br /&gt;
To use GhostPCL, here is a sample invocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat vista_print-0001.pcl | C:\Users\shabiel\workspace\ghostpcl-9.15-win32\pcl6-9.15-win32.exe -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -r600 -sOutputFile=&amp;quot;testpdf.sam&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical PCL String ==&lt;br /&gt;
To construct a PCL in VISTA, you typically put everything in the Open Execute. The Close Execute should always be set to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt; unless you want to do something special. The Form Feed accepts PCL as well.&lt;br /&gt;
&lt;br /&gt;
The typical PCL sequence for an Open Execute is as follows:&lt;br /&gt;
&lt;br /&gt;
* Reset&lt;br /&gt;
* Set Line Carriage mode (CR, CRLF, or LF)&lt;br /&gt;
* Set Orientation (Portrait or Landscape)&lt;br /&gt;
* Set Character Set (optional; not needed for US printing; may need to Spanish)&lt;br /&gt;
* Set Margins (optional; but you will probably need it at some point)&lt;br /&gt;
* Set Font&lt;br /&gt;
&lt;br /&gt;
When constructing a string, I recommend using *27 rather than $C(27) because it&#039;s shorter, and you will type a lot of it.&lt;br /&gt;
&lt;br /&gt;
An example. Note that this needs to be all in one string. It&#039;s separated here for education.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W *27,&amp;quot;E&amp;quot;    ; Reset&lt;br /&gt;
W *27,&amp;quot;&amp;amp;k2G&amp;quot; ; Set Carriage mode to LF.&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l0O&amp;quot; ; Portrait; Landscape is 1O.&lt;br /&gt;
...          ; Character Set Omitted&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l4E&amp;quot; ; Top Margin 4 lines&lt;br /&gt;
W *27,&amp;quot;&amp;amp;a5L&amp;quot; ; Left Martin 5 columns&lt;br /&gt;
W *27,&amp;quot;(s0p12h0s0b4099T&amp;quot; ; Fixed Pitch; 12 cpi, fixed pitch for secondary font, Medium Weight, select courier font.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Functions ==&lt;br /&gt;
I won&#039;t document this in detail, but here are some advanced examples. These ones do headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80-HD         RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p12h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5&lt;br /&gt;
L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h&lt;br /&gt;
0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot; S ($X,$&lt;br /&gt;
Y)=0                                    CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128-HD        RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p17h9v0s0b0T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;l7C&amp;quot;_$C(27&lt;br /&gt;
)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;#&amp;quot;,&amp;quot;&amp;quot;)                     PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(2&lt;br /&gt;
7),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,*27,&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&lt;br /&gt;
(s0p17h9v0s0b0T&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27,69)&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228-HD      RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p22h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p22h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132-HD       RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p14h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 46&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p14h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this one does a watermark:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-PORTRAIT-C16L7-WM            SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96&lt;br /&gt;
  FORM FEED: $c(27)_&amp;quot;*c5760x6000Y&amp;quot;_$c(27)_&amp;quot;*p150x150Y&amp;quot;_$c(27)_&amp;quot;*c0T&amp;quot;_$c(27)_&amp;quot;%1B&lt;br /&gt;
IN;SP1;DI1,-1;SD2,1,4,140,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;_$c&lt;br /&gt;
(3,27)_&amp;quot;%1A&amp;quot;_$c(12)                     PAGE LENGTH: 60&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;(8U&amp;quot;,*27,&amp;quot;(s0P&amp;quot;,*27,&amp;quot;(s16H&amp;quot;,*27,&amp;quot;(s9V&amp;quot;,*27,&amp;quot;(s0S&amp;quot;&lt;br /&gt;
,*27,&amp;quot;(s-3B&amp;quot;,*27,&amp;quot;(s0T&amp;quot;,*27,&amp;quot;&amp;amp;l88P&amp;quot;,*27,&amp;quot;&amp;amp;a255M&amp;quot;,*27,&amp;quot;&amp;amp;k2S&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot;,*27,&amp;quot;&amp;amp;s1C&lt;br /&gt;
&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W *27,&amp;quot;*c5760x6000Y&amp;quot;,*27,&amp;quot;*p150x150Y&amp;quot;,*27,&amp;quot;*c0T&amp;quot;,*27,&amp;quot;%1B&amp;quot;,&amp;quot;IN;&lt;br /&gt;
SP1;DI1,-1;SD1,21,2,1,4,140,5,0,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;&lt;br /&gt;
_$C(3),*27,&amp;quot;%1A&amp;quot;                     DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing PDFs from VISTA ==&lt;br /&gt;
Using GhostPCL, you can directly print out a PDF from VISTA. Here&#039;s an example in GT.M on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PDF WRITER                        $I: PDF-WRITER&lt;br /&gt;
  LOCATION OF TERMINAL: /tmp/           &lt;br /&gt;
  OPEN PARAMETERS: (comm=&amp;quot;pcl6 -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -SOutputFile=&lt;br /&gt;
/tmp/green-sheet.pdf -&amp;quot;)::&amp;quot;pipe&amp;quot;        SUBTYPE: P-HP BARCODER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, you can add a Windows printer that automatically calls GhostPCL. You need to use this amazing piece of software:&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/mfilemon/&lt;br /&gt;
&lt;br /&gt;
Once you install it and configure it, you need to set the $I appropriately.&lt;br /&gt;
&lt;br /&gt;
== Finding the TCP/IP address for a print queue name ==&lt;br /&gt;
On Linux, the lpstat command tells you details about the print queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -v&lt;br /&gt;
&lt;br /&gt;
device for TEST-01: socket://192.168.10.3:9100&lt;br /&gt;
&lt;br /&gt;
device for TEST-02: socket://192.168.10.4:9100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the ready status of a print queue ==&lt;br /&gt;
&lt;br /&gt;
On Linux, the lpstat command tells you all the printers and what their status is.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -a&lt;br /&gt;
&lt;br /&gt;
TEST-01 accepting requests since Sun 25 Dec 2005 09:54:34 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-02 accepting requests since Thu 28 Nov 2013 09:56:11 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-03 accepting requests since Fri 17 Mar 2017 10:03:00 AM EST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR for a particular printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -p  TEST-03&lt;br /&gt;
&lt;br /&gt;
printer TEST-03 is idle.  enabled since Fri 17 Mar 2017 08:39:00 AM EDT&lt;br /&gt;
        Ready to print.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
	<entry>
		<id>https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17197</id>
		<title>VISTA Advanced printing topics</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=VISTA_Advanced_printing_topics&amp;diff=17197"/>
		<updated>2016-10-24T21:39:05Z</updated>

		<summary type="html">&lt;p&gt;Lindamry: /* Communicating with a printer on the network for the first time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Advanced Printing Topics =&lt;br /&gt;
Authored mainly by Sam Habiel, the printer &amp;quot;sensei.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How do computers communicate with printers, software-wise? ==&lt;br /&gt;
This is a pretty difficult topic. Cheaper printers only accept binary data that is hardcoded by the computers; typically these printers are only supported on Windows, and thus are named &amp;quot;Winprinters.&amp;quot; Higher end printers have a processor on them that can typically interpret PCL5, PCL6, and PS; and possibly PDF. These printers are easily supported in Linux. Commercial label printers (like Zebras) always accept their own programming language.&lt;br /&gt;
&lt;br /&gt;
== VISTA and what it really sends ==&lt;br /&gt;
VISTA sends PCL5 to laser printers; or a printer specific language for label printers--most commonly ZPL II for Zebra printers. For laser printers, you need to make sure that your printer supports PCL5. All HP Printers support PCL5, no matter how cheap; other manufacturers only support it on their higher end printers (not too high end--anything that isn&#039;t the cheapest printer may support PCL5). If you need to look it up, go to the manufacturer&#039;s website and look at the technical specs sheet. The section is typically called &amp;quot;supported emulations,&amp;quot; or &amp;quot;supported languages.&amp;quot; What VISTA sends is determined by the sub-type defined for the device.&lt;br /&gt;
&lt;br /&gt;
== Communicating with a printer on the network for the first time ==&lt;br /&gt;
Nothing prevents you from using a USB printer or even a parallel port printer, but in my experience, nobody uses those interfaces in production anymore.&lt;br /&gt;
&lt;br /&gt;
Get the IP address first. You can usually obtain that by printing an information sheet from the printer. Consult the printer manual to find out how to print that information sheet. You can also try to identify the printer from the list of connected hosts on your network.&lt;br /&gt;
&lt;br /&gt;
Whenever I set up a new printer, I tend to ensure that I can talk to it directly, with nothing in the middle. I use the netcat command (&#039;nc&#039;) to do that, connecting to the IP address of the printer on port 9100. Make sure to add the -v flag to netcat so that it can report whether it succeeded in connecting at all. It is very possible that you connected to a printer but you just don&#039;t know which one.&lt;br /&gt;
&lt;br /&gt;
(Aside: This can be done from VISTA using D CALL^%ZISTCP(ip_address,port,time_out)--but netcat is easier.)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of me trying to talk to a PCL printer, so it will print the word &amp;quot;test&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;TEST&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and here&#039;s an example printing a Datamatrix code on a Zebra printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ nc -v 10.10.10.128 9100 &amp;lt;&amp;lt;&amp;lt; &amp;quot;^XA^FO50,100^BXN,10,200^FDTESTTEST^FS^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A successful connection will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Connection to XX.XX.XX.XX 9100 port [tcp/jetdirect] succeeded!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An unsuccessful connection will either just hang or tell you connection refused.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nc: connect to XXXXXXXXX port 9100 (tcp) failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up the printer in the operating system ==&lt;br /&gt;
After confirming the connection, you need to set-up the printer in the operating system. VISTA does NOT need any drivers for the printers to be installed.&lt;br /&gt;
&lt;br /&gt;
== Setting up a printer in VISTA ==&lt;br /&gt;
See [[Setting_up_a_VISTA_Printer|this page]].&lt;br /&gt;
&lt;br /&gt;
== Testing Printers ==&lt;br /&gt;
To test printers in VISTA after setting it up, there are a few steps you have to go through.&lt;br /&gt;
&lt;br /&gt;
If you run this on Cache, Cache steals your IO device between prompts. Therefore U IO to D ^%ZISC need to be on a single line.&lt;br /&gt;
&lt;br /&gt;
Invoke via %ZIS first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
D ^%ZIS&lt;br /&gt;
&lt;br /&gt;
DEVICE: HOME//MY PRINTER&lt;br /&gt;
&lt;br /&gt;
U IO&lt;br /&gt;
&lt;br /&gt;
W &amp;quot;TEST&amp;quot;,!,&amp;quot;TEST&amp;quot;,! D ^%ZISC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the output. If it&#039;s okay, you are ready to move to the next step. If you see the &amp;quot;staircase&amp;quot; effect, you need to go back and set-up the terminal type correctly [[Setting_up_a_Linux_Printer|here]].&lt;br /&gt;
&lt;br /&gt;
The next menu option to try is Send Test Pattern to Terminal [XUTTEST]. If that works, then you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Various troubleshooting topics -- how fun! ==&lt;br /&gt;
There are various issue that come up regularly with VISTA.&lt;br /&gt;
&lt;br /&gt;
=== Laser Printer Issues ===&lt;br /&gt;
Use this page as a reference for PCL:&lt;br /&gt;
&lt;br /&gt;
http://www.pclviewer.com/resources/reference/&lt;br /&gt;
&lt;br /&gt;
==== Extra pages ====&lt;br /&gt;
Extra pages can happen for three different reasons:&lt;br /&gt;
 &lt;br /&gt;
* By default, VISTA prints an extra page after each print job. This is for historical reasons; as most of the early printers were dot-matrix. Today, it&#039;s recommended to disable this. To disable this, you can do it at the device level or the terminal type level. At the device level, set &amp;lt;code&amp;gt;SUPPRESS FORM FEED AT CLOSE&amp;lt;/code&amp;gt; to yes. For the terminal type, set &amp;lt;code&amp;gt;CLOSE EXECUTE&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* The text doesn&#039;t fit the page and spills over to the next page. VISTA printing options must follow the IOSL value (Page Length in Terminal Type or Device--Device overrides Terminal Type). Most of the time this has to do with the fact that the text size for the report is too large; or that the margins are not appropriate. Based on visual inspection, you should decide what to do. The unlikely case is that the VISTA programmer is not obeying IOSL; but that is for you to determine.&lt;br /&gt;
* If both of the above fail, it&#039;s likely that VISTA sends a hard coded form feed to the printer. You need to capture the output by capturing the print to a file (use HFS;subtype) and visually examine it in a programming editor.&lt;br /&gt;
&lt;br /&gt;
==== Wrapping ====&lt;br /&gt;
Typically this has to do with whether the printer is configured to take 132 characters or 80 characters; if not, then it has to do with the font size.&lt;br /&gt;
&lt;br /&gt;
VISTA has these typical formats for printing:&lt;br /&gt;
&lt;br /&gt;
* 12 cpi 8 lpi Portrait (most reports)&lt;br /&gt;
* 17 cpi 7 lpi Portrait (MAR)&lt;br /&gt;
* 14 cpi 6 lpi Landscape (132 wide reports)&lt;br /&gt;
* 22 cpi 12 lpi Landscape (228 wide reports)&lt;br /&gt;
&lt;br /&gt;
==== Only a single line prints ====&lt;br /&gt;
You are seeing the staircase effect. See the Staircase section in [[Setting_up_a_VISTA_Printer]].&lt;br /&gt;
&lt;br /&gt;
=== Zebra Printer Issues ===&lt;br /&gt;
From my memory, these are typically the issues you face:&lt;br /&gt;
&lt;br /&gt;
* Label not aligned vertically&lt;br /&gt;
* Label not aligned horizontally&lt;br /&gt;
* Labels are not dark enough.&lt;br /&gt;
* Label gets cut off&lt;br /&gt;
* VISTA printed labels are too small&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned vertically ====&lt;br /&gt;
Zebras mostly auto calibrate printing on continuous media. Check your Zebra&#039;s manual on how to do that for the specific model.&lt;br /&gt;
&lt;br /&gt;
==== Label not aligned horizontally ====&lt;br /&gt;
Zebras don&#039;t auto align to the width. You have to set the print width yourself. They can detect the start of the label though.&lt;br /&gt;
&lt;br /&gt;
To do that, find your printer dpi setting, and multiply that by the width of your label. E.g. 202 dpi with 3.5&amp;quot;, you need to run this command from the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
^XA^PW707^XZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn&#039;t solve your problem, you need to look carefully at the actual feeding of the label into the zebra printer. Read the manual carefully. I have seen many people &amp;quot;wing it&amp;quot; and do it incorrectly. I have even seen a printer where the left margin guide wasn&#039;t used and a rubber band was placed there. After you turn off the restart the printer, it tries to self calibrate.&lt;br /&gt;
&lt;br /&gt;
==== Label Text is not dark enough ====&lt;br /&gt;
There are two tunable circle things on the top of the print head that can be turned to increase the darkness. Try that. There is also a Zebra setting that can be changed to increase the darkness.&lt;br /&gt;
&lt;br /&gt;
==== Label gets cut off ====&lt;br /&gt;
If the label gets cut off on the right hand side of the label, check your print width (see &#039;Label not aligned horizontally&#039;), and if that&#039;s not the issue, check the position of the ribbon vis a vis the labels. The printer may be trying to print, but there is no ribbon at the place it&#039;s trying to print. If it is getting cut off from the left side, check that your labels are using the left hand guide and are not colliding with it. If it is getting cut off vertically, you need to calibrate the printer. If it still gets cut off, you need to capture the ZPL II that is sent by VISTA and see 1. that it&#039;s formatted correctly and 2. that there isn&#039;t too much information to print.&lt;br /&gt;
&lt;br /&gt;
==== VISTA printed labels are too small ====&lt;br /&gt;
This means that you bought a Zebra printer with the wrong dpi. You have to return it and buy another one. VISTA wants printers with 202 DPI. If you want to use the new printer, you need to re-write some of the label code.&lt;br /&gt;
&lt;br /&gt;
=== Advanced troubleshooting ===&lt;br /&gt;
If you are stuck with a particularly difficult problem, it may be useful to capture the PCL and use a PCL emulator and print to a PDF; or ZPL II and use a Zebra emulator.&lt;br /&gt;
&lt;br /&gt;
To capture an output from VISTA, you need to create a device whose type is HFS but whose destination is pre-determined. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: SAM-DIRECT-HFS-PRINTER            $I: /tmp/op-dev6-lbl-sam.pcl&lt;br /&gt;
  LOCATION OF TERMINAL: File&lt;br /&gt;
  OPEN PARAMETERS: &amp;quot;NWS&amp;quot;                SUBTYPE: P-HPLJ4SI-P12&lt;br /&gt;
  TYPE: HOST FILE SERVER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to change the file for each job, so that they won&#039;t overwrite each other, you can append something to IO in the pre-open execute. Please note that you need to change &amp;quot;NWS&amp;quot; to (newversion) on GT.M.&lt;br /&gt;
&lt;br /&gt;
This is the emulator I use for PCL, http://www.ghostscript.com/GhostPCL.html.&lt;br /&gt;
This is the emulator I use for ZPL II, http://labelary.com/viewer.html&lt;br /&gt;
&lt;br /&gt;
To use GhostPCL, here is a sample invocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat vista_print-0001.pcl | C:\Users\shabiel\workspace\ghostpcl-9.15-win32\pcl6-9.15-win32.exe -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -r600 -sOutputFile=&amp;quot;testpdf.sam&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical PCL String ==&lt;br /&gt;
To construct a PCL in VISTA, you typically put everything in the Open Execute. The Close Execute should always be set to &amp;lt;code&amp;gt;S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&amp;lt;/code&amp;gt; unless you want to do something special. The Form Feed accepts PCL as well.&lt;br /&gt;
&lt;br /&gt;
The typical PCL sequence for an Open Execute is as follows:&lt;br /&gt;
&lt;br /&gt;
* Reset&lt;br /&gt;
* Set Line Carriage mode (CR, CRLF, or LF)&lt;br /&gt;
* Set Orientation (Portrait or Landscape)&lt;br /&gt;
* Set Character Set (optional; not needed for US printing; may need to Spanish)&lt;br /&gt;
* Set Margins (optional; but you will probably need it at some point)&lt;br /&gt;
* Set Font&lt;br /&gt;
&lt;br /&gt;
When constructing a string, I recommend using *27 rather than $C(27) because it&#039;s shorter, and you will type a lot of it.&lt;br /&gt;
&lt;br /&gt;
An example. Note that this needs to be all in one string. It&#039;s separated here for education.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W *27,&amp;quot;E&amp;quot;    ; Reset&lt;br /&gt;
W *27,&amp;quot;&amp;amp;k2G&amp;quot; ; Set Carriage mode to LF.&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l0O&amp;quot; ; Portrait; Landscape is 1O.&lt;br /&gt;
...          ; Character Set Omitted&lt;br /&gt;
W *27,&amp;quot;&amp;amp;l4E&amp;quot; ; Top Margin 4 lines&lt;br /&gt;
W *27,&amp;quot;&amp;amp;a5L&amp;quot; ; Left Martin 5 columns&lt;br /&gt;
W *27,&amp;quot;(s0p12h0s0b4099T&amp;quot; ; Fixed Pitch; 12 cpi, fixed pitch for secondary font, Medium Weight, select courier font.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Functions ==&lt;br /&gt;
I won&#039;t document this in detail, but here are some advanced examples. These ones do headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C12L6-W80-HD         RIGHT MARGIN: 80&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p12h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 58&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l0O&amp;quot;,$C(27),&amp;quot;(0N&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5&lt;br /&gt;
L&amp;quot;,$C(27),&amp;quot;&amp;amp;k2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h&lt;br /&gt;
0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p12h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot; S ($X,$&lt;br /&gt;
Y)=0                                    CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 12 cpi 6 lpi width 80 standard letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-POR-C17L7-W128-HD        RIGHT MARGIN: 128&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2100x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p17h9v0s0b0T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;l7C&amp;quot;_$C(27&lt;br /&gt;
)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;#&amp;quot;,&amp;quot;&amp;quot;)                     PAGE LENGTH: 64&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(2&lt;br /&gt;
7),&amp;quot;*p2100x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,*27,&amp;quot;&amp;amp;l4E&amp;quot;,*27,&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&lt;br /&gt;
(s0p17h9v0s0b0T&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27,69)&lt;br /&gt;
  DESCRIPTION: 17 cpi 7 lpi width 128 standard letter printer (MAR)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C22L12-W228-HD      RIGHT MARGIN: 228&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p22h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 88&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;l0D&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p22h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 22 cpi 12 lpi width 228 landscape letter printer (condensed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-LTR-LAND-C14L6-W132-HD       RIGHT MARGIN: 132&lt;br /&gt;
  FORM FEED: $C(12)_$C(27)_&amp;quot;&amp;amp;f0S&amp;quot;_$C(27)_&amp;quot;&amp;amp;l3E&amp;quot;_$C(27)_&amp;quot;*p2750x,0Y&amp;quot;_$C(27)_&amp;quot;(s1p&lt;br /&gt;
16h0s0b16602THEADER&amp;quot;_$C(27)_&amp;quot;(s0p14h0s0b4099T&amp;quot;_$C(27)_&amp;quot;&amp;amp;l4E&amp;quot;_$C(27)_&amp;quot;&amp;amp;f1S&amp;quot;_$P(&amp;quot;&lt;br /&gt;
#&amp;quot;,&amp;quot;&amp;quot;)                                  PAGE LENGTH: 46&lt;br /&gt;
  BACK SPACE: $C(8)&lt;br /&gt;
  OPEN EXECUTE: W $C(27,69),$C(27),&amp;quot;&amp;amp;l1O&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot;,$C(27),&amp;quot;&amp;amp;a5L&amp;quot;,$C(27),&amp;quot;&amp;amp;k&lt;br /&gt;
2G&amp;quot;,$C(27),&amp;quot;&amp;amp;f0S&amp;quot;,$C(27),&amp;quot;&amp;amp;l3E&amp;quot;,$C(27),&amp;quot;*p2750x,0Y&amp;quot;,$C(27)_&amp;quot;(s1p16h0s0b16602THEADER&amp;quot;,$C(27),&amp;quot;(s0p14h0s0b4099T&amp;quot;,$C(27),&amp;quot;&amp;amp;f1S&amp;quot;,$C(27),&amp;quot;&amp;amp;l4E&amp;quot; S ($X,$Y)=0&lt;br /&gt;
  CLOSE EXECUTE: S IONOFF=&amp;quot;&amp;quot; W $C(27)_&amp;quot;E&amp;quot;&lt;br /&gt;
  DESCRIPTION: 14 cpi 6 lpi width 132 landscape letter printer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this one does a watermark:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: P-HP-PORTRAIT-C16L7-WM            SELECTABLE AT SIGN-ON: NO&lt;br /&gt;
  RIGHT MARGIN: 96&lt;br /&gt;
  FORM FEED: $c(27)_&amp;quot;*c5760x6000Y&amp;quot;_$c(27)_&amp;quot;*p150x150Y&amp;quot;_$c(27)_&amp;quot;*c0T&amp;quot;_$c(27)_&amp;quot;%1B&lt;br /&gt;
IN;SP1;DI1,-1;SD2,1,4,140,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;_$c&lt;br /&gt;
(3,27)_&amp;quot;%1A&amp;quot;_$c(12)                     PAGE LENGTH: 60&lt;br /&gt;
  BACK SPACE: $C(8)                     *OLD XY CRT: 60&lt;br /&gt;
  OPEN EXECUTE: W *27,&amp;quot;E&amp;quot;,*27,&amp;quot;(8U&amp;quot;,*27,&amp;quot;(s0P&amp;quot;,*27,&amp;quot;(s16H&amp;quot;,*27,&amp;quot;(s9V&amp;quot;,*27,&amp;quot;(s0S&amp;quot;&lt;br /&gt;
,*27,&amp;quot;(s-3B&amp;quot;,*27,&amp;quot;(s0T&amp;quot;,*27,&amp;quot;&amp;amp;l88P&amp;quot;,*27,&amp;quot;&amp;amp;a255M&amp;quot;,*27,&amp;quot;&amp;amp;k2S&amp;quot;,*27,&amp;quot;&amp;amp;l7C&amp;quot;,*27,&amp;quot;&amp;amp;s1C&lt;br /&gt;
&amp;quot;,*27,&amp;quot;&amp;amp;k2G&amp;quot;&lt;br /&gt;
  CLOSE EXECUTE: W *27,&amp;quot;*c5760x6000Y&amp;quot;,*27,&amp;quot;*p150x150Y&amp;quot;,*27,&amp;quot;*c0T&amp;quot;,*27,&amp;quot;%1B&amp;quot;,&amp;quot;IN;&lt;br /&gt;
SP1;DI1,-1;SD1,21,2,1,4,140,5,0,6,3,7,4148;SS;PA0,7000;FT10,5;CF2,0;LO21;LBWATERMARK&amp;quot;&lt;br /&gt;
_$C(3),*27,&amp;quot;%1A&amp;quot;                     DESCRIPTION: HP JL4Si 12 pitch Courier&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printing PDFs from VISTA ==&lt;br /&gt;
Using GhostPCL, you can directly print out a PDF from VISTA. Here&#039;s an example in GT.M on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME: PDF WRITER                        $I: PDF-WRITER&lt;br /&gt;
  LOCATION OF TERMINAL: /tmp/           &lt;br /&gt;
  OPEN PARAMETERS: (comm=&amp;quot;pcl6 -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -SOutputFile=&lt;br /&gt;
/tmp/green-sheet.pdf -&amp;quot;)::&amp;quot;pipe&amp;quot;        SUBTYPE: P-HP BARCODER&lt;br /&gt;
  TYPE: TERMINAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Windows, you can add a Windows printer that automatically calls GhostPCL. You need to use this amazing piece of software:&lt;br /&gt;
&lt;br /&gt;
http://sourceforge.net/projects/mfilemon/&lt;br /&gt;
&lt;br /&gt;
Once you install it and configure it, you need to set the $I appropriately.&lt;br /&gt;
&lt;br /&gt;
== Finding the TCP/IP address for a print queue name ==&lt;br /&gt;
On Linux, the lpstat command tells you details about the print queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -v&lt;br /&gt;
&lt;br /&gt;
device for TEST-01: socket://192.168.10.3:9100&lt;br /&gt;
&lt;br /&gt;
device for TEST-02: socket://192.168.10.4:9100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the ready status of a print queue ==&lt;br /&gt;
&lt;br /&gt;
On Linux, the lpstat command tells you all the printers and what their status is.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -a&lt;br /&gt;
&lt;br /&gt;
TEST-01 accepting requests since Sun 25 Dec 2005 09:54:34 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-02 accepting requests since Thu 28 Nov 2013 09:56:11 AM EST&lt;br /&gt;
&lt;br /&gt;
TEST-03 accepting requests since Fri 17 Mar 2017 10:03:00 AM EST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR for a particular printer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lpstat -p  TEST-03&lt;br /&gt;
&lt;br /&gt;
printer TEST-03 is idle.  enabled since Fri 17 Mar 2017 08:39:00 AM EDT&lt;br /&gt;
        Ready to print.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lindamry</name></author>
	</entry>
</feed>