Update ifhp script to something working on 4.X and 5.X. This example is
now similar to the one installed by default in /usr/share/examples/printing/ifhp PR: docs/65766 Submitted by: Simon Barner <barner@in.tum.de>
This commit is contained in:
parent
8aac675ba7
commit
2b371d78f0
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=21207
1 changed files with 4 additions and 12 deletions
|
@ -1936,10 +1936,11 @@ fi</programlisting>
|
|||
<programlisting>#!/bin/sh
|
||||
#
|
||||
# ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500
|
||||
# Installed in /usr/local/libexec/ifhp
|
||||
# Installed in /usr/share/examples/printing/ifhp
|
||||
|
||||
#
|
||||
# Treat LF as CR+LF:
|
||||
# Treat LF as CR+LF (to avoid the "staircase effect" on HP/PCL
|
||||
# printers):
|
||||
#
|
||||
printf "\033&k2G" || exit 2
|
||||
|
||||
|
@ -1953,17 +1954,8 @@ if [ "$first_two_chars" = "%!" ]; then
|
|||
#
|
||||
# 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>&1 1>&2
|
||||
/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 \
|
||||
-sOutputFile=/dev/fd/3 - && exit 0
|
||||
-sOutputFile=- - && exit 0
|
||||
else
|
||||
#
|
||||
# Plain text or HP/PCL, so just print it directly; print a form feed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue