Changes to the form-feed eject sequence for HP/PCL-based printers, plus a

better filter script for Ghostscript scan conversion for non-PostScript
printers.  It also updates the acknowledgements to credit those who've
suggested the changes.

PR:		docs/8547
Submitted by:	Sean Kelly <kelly@plutotech.com>
This commit is contained in:
Nik Clayton 1999-05-16 13:41:53 +00:00
parent e201357174
commit f2ac6a9f50
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=4902
3 changed files with 129 additions and 24 deletions

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$Id: chapter.sgml,v 1.14 1999-04-08 21:51:14 nik Exp $
$Id: chapter.sgml,v 1.15 1999-05-16 13:41:53 nik Exp $
-->
<chapter id="printing">
@ -1370,8 +1370,7 @@ exit 2</programlisting>
# 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,7 +2697,20 @@ first_two_chars=`expr "$first_line" : '\(..\)'`
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
@ -2707,7 +2719,7 @@ else
# 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 @@ exec grops</programlisting>
# 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 @@ total 337.00 154 $ 6.74</screen>
<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>

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$Id: chapter.sgml,v 1.14 1999-04-08 21:51:14 nik Exp $
$Id: chapter.sgml,v 1.15 1999-05-16 13:41:53 nik Exp $
-->
<chapter id="printing">
@ -1370,8 +1370,7 @@ exit 2</programlisting>
# 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,7 +2697,20 @@ first_two_chars=`expr "$first_line" : '\(..\)'`
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
@ -2707,7 +2719,7 @@ else
# 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 @@ exec grops</programlisting>
# 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 @@ total 337.00 154 $ 6.74</screen>
<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>

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$Id: chapter.sgml,v 1.14 1999-04-08 21:51:14 nik Exp $
$Id: chapter.sgml,v 1.15 1999-05-16 13:41:53 nik Exp $
-->
<chapter id="printing">
@ -1370,8 +1370,7 @@ exit 2</programlisting>
# 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,7 +2697,20 @@ first_two_chars=`expr "$first_line" : '\(..\)'`
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
@ -2707,7 +2719,7 @@ else
# 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 @@ exec grops</programlisting>
# 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 @@ total 337.00 154 $ 6.74</screen>
<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>