tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Tri H. Tran" <thtran () hydra ! acs ! uci ! edu>
To: tru64-unix-managers
Subject: PS to PCL converter available?
Date: Tue, 22 Dec 1998 20:16:08 +0000	[thread overview]
Message-ID: <96078731112116.tru64-unix-managers.marc@archive.invalid> (raw)

Hi all,

Anyone know of an easy PS to PCL converter when printing
to a non-postscript printer for a *.ps file?  I've tried
using ghostscript (gs) with some success.  By the way, the
printer is on a remote machine (NT box) serving lpd.
I've included my printcap entry and filter script for
reference.

/etc/printcap:
	
	test:\
        :lp=/dev/null:\
	:if=/soe/lib/filter:\
	:sd=/var/spool/lpd/test:\
        :lf=/var/adm/lpd-errs:

Content of filter script:


	#!/bin/sh
	read first_line
	first_two_chars=`expr "$first_line" : '\(..\)'`

	if [ "$first_two_chars" = "%!" ]; then
        #
        # It is PostScript; use Ghostscript to convert and print it
        # >>> gs with "-sPAPERSIZE=a4" ?
        #
		(echo $first_line && cat) | \
		/filepath/gs -q -sDEVICE=laserjet -sOutputFile=- | \
		/filepath/rlpr -Hhostname -PHP-1100		  
	else
        #
        # Text file
        # >>> send directly to printer
        #
		(echo $first_line && cat) | \
		/filepath/rlpr -Hhostname -PHP-1100
	fi    

	exit 



<------------------------------>
Tri Tran
Office of Academic Computing
E2130 Engineering Gateway
Irvine, CA 92697-2225
(949)824-5887

                 reply	other threads:[~1998-12-22 20:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox