From owner-doc-jp@jp.freebsd.org  Sun Sep 26 20:55:49 1999
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id UAA98413;
	Sun, 26 Sep 1999 20:55:49 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from mail.kt.rim.or.jp (root@mail.kt.rim.or.jp [202.247.130.53])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id UAA98408
	for <doc-jp@jp.freebsd.org>; Sun, 26 Sep 1999 20:55:49 +0900 (JST)
	(envelope-from kuriyama@sky.rim.or.jp)
Received: from rhea.sky.rim.or.jp (ppp534.kt.rim.or.jp [202.247.140.184])
	by mail.kt.rim.or.jp (8.8.8/3.6W-RIMNET-98-06-09) with ESMTP id UAA21002
	for <doc-jp@jp.freebsd.org>; Sun, 26 Sep 1999 20:55:47 +0900 (JST)
Received: from localhost.sky.rim.or.jp (localhost [127.0.0.1])
	by rhea.sky.rim.or.jp (8.9.3/3.7W/rhea-1.1) with ESMTP id UAA59189
	for <doc-jp@jp.freebsd.org>; Sun, 26 Sep 1999 20:55:46 +0900 (JST)
Date: Sun, 26 Sep 1999 20:55:43 +0900
Message-ID: <14318.2495.949279.81928B@localhost.sky.rim.or.jp>
From: Jun Kuriyama <kuriyama@sky.rim.or.jp>
To: Japanese Documentation Project <doc-jp@jp.freebsd.org>
User-Agent: Wanderlust/1.0.3 (Notorious) SEMI/1.13.3 (Komaiko) FLIM/1.12.5 (Hirahata) MULE XEmacs/20.4 (Emerald) (i386--freebsd)
MIME-Version: 1.0 (generated by SEMI 1.13.3 - "Komaiko")
Content-Type: text/plain; charset=ISO-2022-JP
Reply-To: doc-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: doc-jp 6713
Subject: [doc-jp 6713] <handbook> printing/chapter.sgml (1.15)
Errors-To: owner-doc-jp@jp.freebsd.org
Sender: owner-doc-jp@jp.freebsd.org
X-Originator: kuriyama@sky.rim.or.jp


$B!!%3%a%s%H$N$H$3$m$OLu$5$J$$$G$$$$$H;W$&$N$G!"8eH>ItJ,$@$1$+$J!#(B

Index: chapter.sgml
===================================================================
RCS file: /home/ncvs/doc/en_US.ISO_8859-1/books/handbook/printing/chapter.sgml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- chapter.sgml	1999/04/08 21:51:14	1.14
+++ chapter.sgml	1999/05/16 13:41:53	1.15
@@ -1,7 +1,7 @@
 <!--
      The FreeBSD Documentation Project
 
-     $Id: chapter.sgml,v 1.12 1999/03/08 22:04:47 nik Exp $
+     $Id: chapter.sgml,v 1.14 1999/04/08 21:51:14 nik Exp $
 -->
 
 <chapter id="printing">
@@ -1370,8 +1370,7 @@
 # Installed in /usr/local/libexec/hpif
 #
 # Simply copies stdin to stdout.  Ignores all filter arguments.
-# Tells printer to treat LF as CR+LF. Writes a form feed character
-# after printing job.
+# Tells printer to treat LF as CR+LF.  Ejects the page when done.
 
 printf "\033&amp;k2G" &amp;&amp; cat &amp;&amp; printf "\033&amp;l0H" &amp;&amp; exit 0
 exit 2</programlisting>
@@ -2698,8 +2697,21 @@
 
 if [ "$first_two_chars" = "%!" ]; then
     #
-    #  It is PostScript; use Ghostscript to scan-convert and print it
+    #  It is PostScript; use Ghostscript to scan-convert and print it.
     #
+    #  Note that PostScript files are actually interpreted programs,
+    #  and those programs are allowed to write to stdout, which will
+    #  mess up the printed output.  So, we redirect stdout to stderr
+    #  and then make descriptor 3 go to stdout, and have Ghostscript
+    #  write its output there.  Exercise for the clever reader:
+    #  capture the stderr output from Ghostscript and mail it back to
+    #  the user originating the print job.
+    #
+    exec 3&gt;&amp;1 1&gt;&amp;2
+    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 \
+        -sOutputFile=/dev/fd/3 - &amp;&amp; exit 0
+
+    #
     /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 -sOutputFile=- - \
         &amp;&amp; exit 0
 else
@@ -2707,7 +2719,7 @@
     #  Plain text or HP/PCL, so just print it directly; print a form
     #  at the end to eject the last page.
     #
-    echo "$first_line" &amp;&amp; cat &amp;&amp; printf "\f" &amp;&amp; exit 0
+    echo $first_line &amp;&amp; cat &amp;&amp; printf "\033&amp;l0H" &amp;&amp; exit 0
 fi
 
 exit 2</programlisting>
@@ -2999,7 +3011,7 @@
 # Installed in /usr/local/libexec/hprf
 #
 
-printf "\033&amp;k2G" &amp;&amp; fpr &amp;&amp; printf "\f" &amp;&amp; exit 0
+printf "\033&amp;k2G" &amp;&amp; fpr &amp;&amp; printf "\033&amp;l0H" &amp;&amp; exit 0
 exit 2</programlisting>
 	      
 	  <para>And we will add this line to the
@@ -4601,8 +4613,31 @@
 	  <para>For the Ghostscript-to-HP filter.</para>
 	</listitem>
       </varlistentry>
-	    
-      <varlistentry><term>My wife, Mary Kelly
+
+      <varlistentry>
+	<term>&a.jfieber;</term>
+	
+	<listitem>
+	  <para> For debugging why printing from Windows 95 to a FreeBSD
+	    system simulating a PostScript printer with Ghostscript didn't
+	    produce correct output, and suggesting a fix, which is included
+	    herein.</para>
+	</listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term>Stephen Montgomery-Smith
+	  <email>stephen@math.missouri.edu</email></term>
+
+	<listitem>
+	  <para>For suggesting using "\033&amp;l0H" instead of "\f" to eject
+	    the last page on HP printers; the latter could eject an extra
+	    blank page while the former never does.</para>
+	</listitem>
+      </varlistentry>
+      
+      <varlistentry>
+	<term>My wife, Mary Kelly
 	  <email>urquhart@argyre.colorado.edu</email></term>
 	
 	<listitem>


$B$/$j$d$^(B // kuriyama@sky.rim.or.jp
        // kuriyama@FreeBSD.ORG
