From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,61a07a883bd8f2b6 X-Google-Attributes: gidfee84,public From: Ernest LaBonte Subject: Re: Help printing from Alpha to Lexmark RT Date: 1998/02/18 Message-ID: <6ceqdc$em8$1@lead.zk3.dec.com> X-Deja-AN: 326226764 References: <34e62c84.38794455@news.uth.tmc.edu> Mime-Version: 1.0 To: "David S. Loose-Mitchell" Content-Type: multipart/mixed; boundary="------------2781446B794B" Organization: UBPG Newsgroups: comp.unix.osf.osf1 This is a multi-part message in MIME format. --------------2781446B794B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit David S. Loose-Mitchell wrote: > > Anyone out there know how to write the princap file for a Lexmark > printer from OSF 3.2c? The Lexmark is a true network printer in that > it has its own netcard and runs LPR/LPD; it supports both postscript 1 > and 2 and HPL-5. I can sent data to the printer with no problem but > it's woefully misformatted. > > Cheers, > David --------------2781446B794B Content-Type: text/plain; charset=us-ascii; name="t.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="t.txt" Using V3.2c you only have access to the network printer via lpd remote printing. Lpd remote printing does not utilize print filters so all file formatting must be done prior to printing. Digital UNIX V4.0a and later provides tcp/ip socket printing which I believe the Lexmark network card supports. Tcp printing can be used with print filters. Digital UNIX V4.0d includes a print filter that can be customized which would resolve your problem. If/when you do upgraded to V4.0d look in /usr/lbin/pcf/*pcf for printer configuration files. Use these as examples. As for V3.2c since this is a postscript printer you can do the following: Converting text to postscript in portrait mode and print: > cat text_file | /usr/lbin/ln03rof | lpr -Pprinter Converting text to postscript in landscape mode and print: > cat text_file | /usr/lbin/ln03rof -w 132 | lpr -Pprinter The ln03rof filter cannot convert pcl or hpgl to postscript. These file types should be printed as is without any modifications. I have included a file preprocessing script below called lprcat. This script provides a front to the lpr utility. The main feature of this script is that it will process multiple files prior to submitting it to the remote print queue. eg: lprcat -Pqueue -options file1 file2 file3 ---------------------------- #!/bin/ksh # lprcat 19-May-1996 # # General purpose script to preprocess a file prior to printing. Useful when # printing to a remote queue or to a network printer using lpd remote # communication. # # The default is to convert text to postscript using the /usr/lbin/ln03rof # filter but any filter can be specified/utilized. # # Usage: script [-ffilter] [options] file file ... # # [filter] - use an alternate filter located in /usr/lbin. # [options] - options that would be specified in a lpr command line. # file - the file or files to print # # eg: script -Pxxx -w50 -Olandscape file file # script -flpf -Pxxx -x -h file file # # Function: fcat # # Description: Cat one or more files through a print filter # # Arguments: $1 - filter to use # $2 - optional filter arguments # $3-$* - additional filenames # function fcat { filter=$1 # Save the filter name shift cmd=$1 # Optional filter arguments shift while [[ -n $1 ]] # Cat each filename provided through the filter do eval /bin/cat $1 | $filter $cmd shift done } # Function: fverify # # Description: Verify all the files exist. # # Arguments: $* - List of filenames to list # function fverify { while [[ -n $1 ]] do if [[ ! -f $1 ]] then print "ERROR: Unable to print file $1." exit 1 fi shift done } # Initialize variables filter="/usr/lbin/ln03rof" cmd="" queue="" xf="" sh="" # # Code starts here # # Parse out filter options and lpr options # Of course it's up to the filter to decide if the option will be used. while getopts :f:P:z:w:i:O:K:I:o:l:xhs opt do case $opt in P) queue="-P$OPTARG " # Queue name ;; h) sh="-h " # Suppress banner page ;; x) xf="-x " # Use xf filter ;; f) filter="/usr/lbin/$OPTARG" # Specify alternate filter ;; i) cmd="$cmd -i$OPTARG" # Indent ;; l) cmd="$cmd -l$OPTARG" # Page length. Filter option. ;; o) cmd="$cmd -o$OPTARG" # Output tray ;; s) print "ERROR: Symbolic link option -s not allowed!" exit 1 ;; w) cmd="$cmd -w$OPTARG" # Page width ;; z) cmd="$cmd -l$OPTARG" # Page length if lpr did support it. ;; I) cmd="$cmd -I$OPTARG" # Input tray ;; O) cmd="$cmd -O$OPTARG" # Orientation ;; \?) print "ERROR: Unknown option $OPTARG." exit 1 ;; :) print "ERROR: Option $OPTARG requires a parameter." exit 1 esac done # Now remove all the options and (hopefully) leave only file names shift $OPTIND-1 # Check to see if the print filter exists [[ ! -a $filter ]] && print "ERROR: Print filter $filter not found!" && exit 1 # If no filenames print a message and get out [[ -z $* ]] && print "ERROR: Missing filename argument!" && exit 1 # Check to see if all the files specified exist fverify $* # The way the command option string is created the first two characters are # - so if a command string exists remove the leading space [[ -n $cmd ]] && cmd=$(print "$cmd" | /bin/cut -c2- ) # Now run each file through the filter and pipe the results to lpr fcat "$filter" "$cmd" $* | /bin/lpr $queue$sh$x --------------2781446B794B--