Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jun 2003 07:21:34 -0000
From:      tollallenamensindbelegt@t-online.de
To:        freebsd-questions@freebsd.org
Subject:   can't print postscript files
Message-ID:  <20030522143851.GA729@lisa.home.net>

next in thread | raw e-mail | index | archive | help
Hi I,
had configure my /etc/printcap like the example in the freebsd handbook but I'm not 
able to print postscript files I thing I  have a little misstake in the gs section in this script  
/usr/local/libexec/hl7x0 because I can print plaintext files.

my printer is a brother HL-730 

could any one give me the answer where is the misstake that I'm not able to print ps file. 

thanks!!!

best regards 

Michael Bohn 

mailto: tollallenamensindbelegt@t-online.de



/etc/printcap 

#
lp|brother730:\
        :sh:sd=/var/spool/lpd/brother730:\
        :lp=/dev/lpt0:\
        :if=/usr/local/libexec/hl7x0:\
        :df=/usr/local/libexec/psdf:
#

#################################################################

#!/bin/sh
#
#  ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500
#  Installed in /usr/local/libexec/hl7x0

#
#  Treat LF as CR+LF:
#
printf "\033&k2G" || exit 2

#
#  Read first two characters of the file
#
IFS="" read -r first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

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=hl7x0 \
        -sOutputFile=/dev/lpt0 - && exit 0
else
    #
    #  Plain text or HP/PCL, so just print it directly; print a form feed
    #  at the end to eject the last page.
    #
   echo "$first_line" && cat && printf "\033&l0H" &&
exit 0
fi

exit 2

###########################################################################



bash-2.05b# cd /var/spool/lpd
bash-2.05b# ls -l
total 14
-rw-r----x  1 daemon  daemon     4 22 Mai 15:07 .seq
drwxr-xr-x  2 daemon  daemon  1024 22 Mai 16:08 brother730
-rw-rw-r--  1 daemon  daemon    25 22 Mai 15:07 lock
drwxr-xr-x  2 daemon  daemon   512 21 Mai 12:42 lp
-rw-rw-r--  1 daemon  daemon    27 22 Mai 15:07 status



############################################################################




bash-2.05b# pwd
/usr/local/libexec
bash-2.05b# ls -la
total 2732
drwxr-xr-x   7 root  wheel      512 21 Mai 13:38 .
drwxr-xr-x  15 root  wheel      512 16 Mai 23:27 ..
drwxr-xr-x   2 root  wheel      512 16 Mai 21:26 autoconf213
drwxr-xr-x   2 root  wheel      512 16 Mai 21:26 automake14
drwxr-xr-x   6 root  wheel      512 16 Mai 20:08 cups
drwxr-xr-x   3 root  wheel      512 16 Mai 20:51 emacs
-r-xr-xr-x   1 root  wheel    18492  3 Jan 13:17 grmt
-r-xr-xr-x   1 root  wheel     1205 22 Mai 16:20 hl7x00
-r-xr-xr-x   1 root  wheel      196 21 Mai 12:47 if-simple
-r-xr-xr-x   1 root  wheel    15460 21 Mai 13:37 lprps
-r-xr-xr-x   1 root  wheel  2699888 17 Mai 07:27 mysqld
-r-xr-xr-x   1 root  wheel       64 22 Mai 15:06 necp6-iso-filter
-r-xr-xr-x   1 root  wheel      199 21 Mai 13:22 psdf
-r-xr-xr-x   1 root  wheel     4832 21 Mai 13:37 psif
-r-xr-xr-x   1 root  wheel       42 21 Mai 13:37 psif-ps
-r-xr-xr-x   1 root  wheel       66 21 Mai 13:37 psif-text
-r-xr-xr-x   1 root  wheel     7396 21 Mai 13:37 psof
drwxr-xr-x   2 root  wheel      512 16 Mai 20:04 w3m
bash-2.05b# 
################################################################################



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030522143851.GA729>