Re: can't print postscript files

2003-07-02 Thread Malcolm Kay
On Fri, 23 May 2003 00:08, [EMAIL PROTECTED] wrote:
 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: [EMAIL PROTECTED]



 /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 \033k2G || 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 31 12
 /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=hl7x0 \
 -sOutputFile=/dev/lpt0 -  exit 0

'lpd' expects the fifter output on STDOUT which from the exec command 
comes from the redirected file descriptor 3. So the gs output should be 
specified -sOutputFile=/dev/fd/3 which is another of addressing file 
descriptor 3. The final destination of /dev/lpt0 comes from printcap.

 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 \033l0H 
 exit 0
 fi

 exit 2

 ###


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


can't print postscript files

2003-06-22 Thread tollallenamensindbelegt
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: [EMAIL PROTECTED]



/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 \033k2G || 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 31 12
/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 \033l0H 
exit 0
fi

exit 2

###



bash-2.05b# cd /var/spool/lpd
bash-2.05b# ls -l
total 14
-rw-rx  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  daemon25 22 Mai 15:07 lock
drwxr-xr-x  2 daemon  daemon   512 21 Mai 12:42 lp
-rw-rw-r--  1 daemon  daemon27 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  wheel18492  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  wheel15460 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# 


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: can't print postscript files

2003-06-22 Thread Malcolm Kay
On Sun, 22 Jun 2003 23:06, Warren Block wrote:
 On Thu, 22 May 2003 [EMAIL PROTECTED] wrote:
  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.

 What actually does print when you try to print a PostScript file?  Are
 there any error messages?

 Your printcap file does not use ifhp, unless that's called from hl7x0.
 And the ifhp script is flawed; many PostScript files start with HP PJL
 sequences that ifhp does not detect.


Notice the date of the original posting. Somehow this is is an old e-mail
that has becme recycled. I believe the OP has had his problem solved.

Malcolm
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]