<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://vistapedia.com/index.php?action=history&amp;feed=atom&amp;title=Setting_up_a_Linux_Printer_Old</id>
	<title>Setting up a Linux Printer Old - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://vistapedia.com/index.php?action=history&amp;feed=atom&amp;title=Setting_up_a_Linux_Printer_Old"/>
	<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=Setting_up_a_Linux_Printer_Old&amp;action=history"/>
	<updated>2026-05-02T08:10:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://vistapedia.com/index.php?title=Setting_up_a_Linux_Printer_Old&amp;diff=16384&amp;oldid=prev</id>
		<title>Shabiel: Created page with &quot;=== GT.M pipe for print DEVICE (older way): ===  With the introduction of the pipe device to GT.M (version V5.3-003) this simple, secure, and elegant method can be used:  * To...&quot;</title>
		<link rel="alternate" type="text/html" href="https://vistapedia.com/index.php?title=Setting_up_a_Linux_Printer_Old&amp;diff=16384&amp;oldid=prev"/>
		<updated>2015-06-09T15:43:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=== GT.M pipe for print DEVICE (older way): ===  With the introduction of the pipe device to GT.M (version V5.3-003) this simple, secure, and elegant method can be used:  * To...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== GT.M pipe for print DEVICE (older way): ===&lt;br /&gt;
&lt;br /&gt;
With the introduction of the pipe device to GT.M (version V5.3-003) this simple, secure, and elegant method can be used:&lt;br /&gt;
&lt;br /&gt;
* To begin, [[Begin_Configuration_of_Vista#Update_the_Devices,_Start_Taskman_and_Mail_a_Message|Update the Devices]] file. To create a new DEVICE, enter an unused NAME of your choice.&lt;br /&gt;
&lt;br /&gt;
                   NAME: HP-PHOTOSMART                     &lt;br /&gt;
                     $I: &amp;lt;pipe&amp;gt;&lt;br /&gt;
       PRE-OPEN EXECUTE: X &amp;quot;o &amp;quot;&amp;quot;p&amp;quot;&amp;quot;:(command=&amp;quot;&amp;quot;lpr&amp;quot;&amp;quot;)::&amp;quot;&amp;quot;pipe&amp;quot;&amp;quot; s IO=&amp;quot;&amp;quot;p&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     POST-CLOSE EXECUTE: X &amp;quot;c &amp;quot;&amp;quot;p&amp;quot;&amp;quot;&amp;quot;                  &lt;br /&gt;
                SUBTYPE: P-OTHER80&lt;br /&gt;
                   TYPE: OTHER&lt;br /&gt;
  &lt;br /&gt;
Note: We use [[FILE_3.5|TYPE:OTHER]] rather than Host File Server. No host file needed; output will be &amp;quot;piped&amp;quot; to the default CUPS printer. Also the fancy stuff is in the PRE-OPEN EXECUTE. For example, one can write: &lt;br /&gt;
&lt;br /&gt;
       PRE-OPEN EXECUTE: X &amp;quot;o &amp;quot;&amp;quot;p&amp;quot;&amp;quot;:(command=&amp;quot;&amp;quot;lpr -P Photosmart_@192.168.5.103 -o cpi=12 -o lpi=8 -o page-left=72&amp;quot;&amp;quot;)::&amp;quot;&amp;quot;pipe&amp;quot;&amp;quot; s IO=&amp;quot;&amp;quot;p&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In human (ok in geekspeak), this last PRE-OPEN EXECUTE says, &amp;quot;Open a pipe device named &amp;quot;p&amp;quot; with the command to print to the CUPS printer named &amp;quot;Photosmart_@192.168.5.103&amp;quot;. Set it to give us 12 characters/inch, 8 lines/inch and a 1 inch left margin). And then set IO to that device.&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
FileMan will then send his output to that IO device, the just-defined pipe. &lt;br /&gt;
 &lt;br /&gt;
Finally, the POST-CLOSE EXECUTE simply closes the pipe. And it&amp;#039;s gone. No Linux /tmp/print.txt file to clean up. No fuss, no muss. &lt;br /&gt;
&lt;br /&gt;
Another option is to define the device with option raw:&lt;br /&gt;
 PRE-OPEN EXECUTE: X &amp;quot;o &amp;quot;&amp;quot;p&amp;quot;&amp;quot;:(command=&amp;quot;&amp;quot;lpr -P 1100A -o raw&amp;quot;&amp;quot;)::&amp;quot;&amp;quot;pipe&amp;quot;&amp;quot; s IO=&amp;quot;&amp;quot;p&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
And then the SUBTYPE can manage the details of formating... Portrait vs Landscape and fonts, etc.&lt;br /&gt;
----&lt;br /&gt;
==== [[pipe to identify CUPS printers]] ====&lt;br /&gt;
&lt;br /&gt;
--[[User:JohnLeoZ|JL.Z]] Aug 2009&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== VistA output to a temporary Linux file (Calling ^TMGPRNTR) (older) ===&lt;br /&gt;
&lt;br /&gt;
Below is an older way of setting up a Linux printer.&lt;br /&gt;
 &lt;br /&gt;
Here is the DEVICE file entry:&lt;br /&gt;
 &lt;br /&gt;
                         NAME: S121-LAUGHLIN-LASER&lt;br /&gt;
                           $I: &amp;lt;TO BE SET IN PRE-OPEN EX.&amp;gt;    &lt;br /&gt;
         LOCATION OF TERMINAL: Laughlin_Office&lt;br /&gt;
  SUPPRESS FORM FEED AT CLOSE: YES   &lt;br /&gt;
                  PAGE LENGTH: 70                   &lt;br /&gt;
             PRE-OPEN EXECUTE: SET IO=&amp;#039;&amp;#039;&amp;#039;$$GETJOBNM^TMGPRNTR()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
           POST-CLOSE EXECUTE: DO &amp;#039;&amp;#039;&amp;#039;FINISH^TMGPRNTR(&amp;quot;laughlin_laser&amp;quot;)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
                      SUBTYPE: P-OTHER80          &lt;br /&gt;
                         TYPE: HOST FILE SERVER&lt;br /&gt;
&lt;br /&gt;
Here are the supporting calls to routine ^TMGPRNTR that create a file for writing, and then send the output file to the Linux lpr system&lt;br /&gt;
&lt;br /&gt;
 GETJOBNM()&lt;br /&gt;
        ;&amp;quot;Purpose: To create a unique printer job name.  &lt;br /&gt;
        ;&amp;quot;        This will be used during a printing process&lt;br /&gt;
        ;&amp;quot;        that writes the printer file to the host file system, &lt;br /&gt;
        ;&amp;quot;        then passes file to Linux&lt;br /&gt;
        ;&amp;quot;        printing system.&lt;br /&gt;
        ;&amp;quot;Output: Returns name of file to put output into&lt;br /&gt;
        &lt;br /&gt;
        ;&amp;quot;UNIQUE will generate a filename based on time and job number&lt;br /&gt;
        ;&amp;quot;    i.e. &amp;#039;Print-Job-628233034.tmp&lt;br /&gt;
        &lt;br /&gt;
        ;&amp;quot;write !,&amp;quot;here in GETJOBNM^TMGPRNTR&amp;quot;,!&lt;br /&gt;
        new cJobs set cJobs=&amp;quot;PRINT JOBS&amp;quot;&lt;br /&gt;
        new Filename set Filename=$$UNIQUE^%ZISUTL(&amp;quot;/tmp/Print-Job.tmp&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
        ;&amp;quot;Now store Filename for later transfer to Linux lpr&lt;br /&gt;
        new index set index=$order(^TMP(&amp;quot;TMG&amp;quot;,cJobs,$J,&amp;quot;&amp;quot;))&lt;br /&gt;
        if index=&amp;quot;&amp;quot; set index=1&lt;br /&gt;
        set ^TMP(&amp;quot;TMG&amp;quot;,cJobs,$J,index)=Filename&lt;br /&gt;
        &lt;br /&gt;
        ;&amp;quot;write !,&amp;quot;Print job name will be:&amp;quot;,Filename,!&lt;br /&gt;
        quit Filename   ;&amp;quot;result returned by altering Filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 FINISH(Printer)&lt;br /&gt;
        ;&amp;quot;Purpose: to complete the printing process by sending the now-created file&lt;br /&gt;
        ;&amp;quot;        to Linux CUPS (the printing system).&lt;br /&gt;
        ;&amp;quot;Note: The lpr system itself will delete this print file when &lt;br /&gt;
        ;&amp;quot;      done (option -r)&lt;br /&gt;
        ;&amp;quot;Input: Printer OPTIONAL -- the name of the linux printer to send the job to.&lt;br /&gt;
        &lt;br /&gt;
        new cJobs set cJobs=&amp;quot;PRINT JOBS&amp;quot;&lt;br /&gt;
        new index set index=$order(^TMP(&amp;quot;TMG&amp;quot;,cJobs,$J,&amp;quot;&amp;quot;))&lt;br /&gt;
        new Filename set Filename=$get(^TMP(&amp;quot;TMG&amp;quot;,cJobs,$J,index))&lt;br /&gt;
        &lt;br /&gt;
        close IO&lt;br /&gt;
        kill IO(1,IO)&lt;br /&gt;
         &lt;br /&gt;
        kill ^TMP(&amp;quot;TMG&amp;quot;,cJobs,$J,index)&lt;br /&gt;
        if Filename&amp;#039;=&amp;quot;&amp;quot; do&lt;br /&gt;
        . new CmdStr&lt;br /&gt;
        . set CmdStr=&amp;quot;lpr &amp;quot;&lt;br /&gt;
        . if $get(Printer)&amp;#039;=&amp;quot;&amp;quot; set CmdStr=CmdStr_&amp;quot;-P &amp;quot;_Printer&lt;br /&gt;
        . ;&amp;quot;option -r --&amp;gt; lpr deletes file after printing done.&lt;br /&gt;
        . set CmdStr=CmdStr_&amp;quot; -r &amp;quot;_Filename_&amp;quot; &amp;amp;&amp;quot;&lt;br /&gt;
        . ;&amp;quot;write !,&amp;quot;Here is where I call:&amp;quot;,!,&amp;quot;ZSYSTEM &amp;quot;_CmdStr,!&lt;br /&gt;
        . zsystem CmdStr&lt;br /&gt;
        . ;&amp;quot;write &amp;quot;Back from zsystem.  Returning to Fileman.&amp;quot;,!&lt;br /&gt;
        &lt;br /&gt;
        quit&lt;br /&gt;
&lt;br /&gt;
--[[User:Kdtop|Kdtop]] 10:34, 18 Sep 2005)&lt;br /&gt;
----&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Linux /tmp/file (With ZSYSTEM call)&amp;#039;&amp;#039;&amp;#039; (older) ===&lt;br /&gt;
&lt;br /&gt;
On a Linux system with CUPS.&lt;br /&gt;
&lt;br /&gt;
                   NAME: PRINTSERVER                      &lt;br /&gt;
                     $I: /tmp/vistaprint.txt&lt;br /&gt;
   LOCATION OF TERMINAL: lpr           &lt;br /&gt;
             OPEN COUNT: 1&lt;br /&gt;
     POST-CLOSE EXECUTE: X &amp;quot;ZSYSTEM &amp;quot;&amp;quot;lpr -r /tmp/vistaprint.txt&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
                SUBTYPE: P-OTHER80                 &lt;br /&gt;
                   TYPE: HOST FILE SERVER&lt;br /&gt;
&lt;br /&gt;
And for an elaboration of this method &lt;br /&gt;
&lt;br /&gt;
                   NAME: HP-PHOTOSMART                     &lt;br /&gt;
                     $I: &amp;lt;TO BE SET IN PRE-OPEN EXECUTE&amp;gt;&lt;br /&gt;
       PRE-OPEN EXECUTE: S IO=&amp;quot;/tmp/&amp;quot;_$J_&amp;quot;print.txt&amp;quot;&lt;br /&gt;
     POST-CLOSE EXECUTE: X &amp;quot;ZSYSTEM &amp;quot;&amp;quot;lpr -P Photosmart_@192.168.5.103 -r /tmp/&amp;quot;&amp;quot;_$J_&amp;quot;&amp;quot;print.txt&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
                SUBTYPE: P-OTHER80&lt;br /&gt;
                   TYPE: HOST FILE SERVER&lt;br /&gt;
&lt;br /&gt;
Note: This DEVICE does not require the calls to ^TMGPRNTR. And, by exposing the lpr call in the POST-CLOSE EXECUTE, it allows more flexibility. For example, this relatively simple change will direct output to the default CUPS printer with 12 characters/inch, 8 lines/inch and a 1 inch left margin. :&lt;br /&gt;
&lt;br /&gt;
      POST-CLOSE EXECUTE: X &amp;quot;ZSYSTEM &amp;quot;&amp;quot;lpr -o cpi=12 -o lpi=8 -o page-left=72 -r /tmp/&amp;quot;&amp;quot;_$J_&amp;quot;&amp;quot;print.txt&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Shabiel</name></author>
	</entry>
</feed>