| Summary: | [printing] Fdescfs needs to be mounted on FreeBSD 5.x | ||
|---|---|---|---|
| Product: | Documentation | Reporter: | Simon Barner <barner> |
| Component: | Books & Articles | Assignee: | Marc Fonvieille <blackend> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Latest | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Simon Barner
2004-04-19 16:30:19 UTC
On Mon, Apr 19, 2004 at 05:23:41PM +0200, Simon Barner wrote: > > >Fix: > > The following line in /etc/fstab > > fdescfs /dev/fd fdescfs rw 0 0 > > and a mount /dev/fd made my printer work. > [...] Could you try this script: #!/bin/sh printf "\033&k2G" || exit 2 IFS="" read -r first_line first_two_chars=`expr "$first_line" : '\(..\)'` case "${first_two_chars}" in \%\!*) /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 \ -sOutputFile=- - && exit 0 ;; *) echo "$first_line" && cat && printf "\033&l0H" && exit 0 ;; esac exit 2 You will have to comment the 2nd line if you use an Epson printer (it's your case) and don't forget to use the right device for -sDEVICE. > Furthermore I'd like to add that I had to remove the following line from > the ifhp example filter: > > printf "\033&k2G" || exit 2 > (I am using an Epson Stylus Color 740 via the stcolor driver, GNU > Ghostscript 7.07). It's normal this line is for HP printers Marc Marc Fonvieille wrote: > Could you try this script: [...] Thanks, that works nicely (without fdescfs). > You will have to comment the 2nd line if you use an Epson printer (it's > your case) and don't forget to use the right device for -sDEVICE. > > > Furthermore I'd like to add that I had to remove the following line from > > the ifhp example filter: > > > > printf "\033&k2G" || exit 2 > > (I am using an Epson Stylus Color 740 via the stcolor driver, GNU > > Ghostscript 7.07). > > It's normal this line is for HP printers Perhaps this could be mentioned in the handbook? Simon > #!/bin/sh
>
> printf "\033&k2G" || exit 2
>
> IFS="" read -r first_line
> first_two_chars=`expr "$first_line" : '\(..\)'`
>
> case "${first_two_chars}" in
> \%\!*)
> /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 \
> -sOutputFile=- - && exit 0
> ;;
> *)
> echo "$first_line" && cat && printf "\033&l0H" && exit 0
> ;;
> esac
>
> exit 2
I just had another look at the original script:
#
# 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.
#
Your script does not pay attention to the fact that postscript program
might mess up stdout, so I guess there is no way around the redirection
to fd 3.
Is there anything bad about having fdecsfs mounted?
Responsible Changed From-To: freebsd-doc->blackend I'll take care of this one. State Changed From-To: open->closed I updated the Handbook example. Thanks. |