* Help printing from Alpha to Lexmark RT
@ 1998-02-14 5:00 David S. Loose-Mitchell
1998-02-15 5:00 ` Scott Collins
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: David S. Loose-Mitchell @ 1998-02-14 5:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Help printing from Alpha to Lexmark RT
1998-02-14 5:00 Help printing from Alpha to Lexmark RT David S. Loose-Mitchell
@ 1998-02-15 5:00 ` Scott Collins
1998-02-18 5:00 ` Ernest LaBonte
1998-02-26 5:00 ` mark vallee
2 siblings, 0 replies; 5+ messages in thread
From: Scott Collins @ 1998-02-15 5:00 UTC (permalink / raw)
David,
The printer sounds as though it is fully able to act as an lpd print server
and I assume that it auto-senses Postscript or PCL input. It sounds as
though straight text input (which goes through the PCL interpreter) is your
problem. If the formatting has a kind of stairway effect, where each new
line starts horizontally where the previous line ended, I know what your
problem is. DOS/Windoze supply CR/LF (carriage return & line feed) pairs to
terminate lines which is the default for most printers. UNIX however ends
each line with only a LF which does not reset the cursor position to the
left margin on printers configured like this.
You have three options. Use a utility such as "mpage" which formats your
output and sends it to the printer as postscript, reconfigure the printer to
act properly with just LF characters to terminate lines, or use a printcap
file which resets the printers PCL interpreter to treat lone LF's properly.
Following is a korn shell script which contains a printcap file which resets
the printers PCL interpreter to treat lone LF's properly by using the
script.
================================================
#!/bin/ksh
#
# Name: hpljf
# Author: Scott Collins
# Purpose: HP Laserjet UNIX printer filter
#
# Directions:
# Place this file "hpljf" into /usr/local/bin. This file is the
# printer filter. The file paths to the binaries in this script may
# need to be changed for your system.
#
#######################################################################
# Set up your printer in the /etc/printcap. Add the following
# text in it, or whatever paths are appropriate to your system.
#
#
# lp0|lj|0:\
# :lf=/usr/adm/lp0err:\
# :lp=:\
# :rm=printer.name.here:\
# :rp=ps:\
# :if=/usr/local/bin/hpljf:\
# :mx#0:sh:\
# :sd=/usr/spool/lpd0:
#
#######################################################################
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
echo -ne "\033E\c" # reset printer
echo -ne "\\033)0B\c" # secondary character set line draw
echo -ne "\\033&k2G\c" # set line termination mode
cat
echo -ne "\\f"
=========================================================
David S. Loose-Mitchell wrote in message
<34e62c84.38794455@news.uth.tmc.edu>...
>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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help printing from Alpha to Lexmark RT
1998-02-14 5:00 Help printing from Alpha to Lexmark RT David S. Loose-Mitchell
1998-02-15 5:00 ` Scott Collins
@ 1998-02-18 5:00 ` Ernest LaBonte
1998-02-26 5:00 ` mark vallee
2 siblings, 0 replies; 5+ messages in thread
From: Ernest LaBonte @ 1998-02-18 5:00 UTC (permalink / raw)
To: David S. Loose-Mitchell
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
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
[-- Attachment #2: t.txt --]
[-- Type: text/plain, Size: 4346 bytes --]
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
# <space>- 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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Help printing from Alpha to Lexmark RT
1998-02-14 5:00 Help printing from Alpha to Lexmark RT David S. Loose-Mitchell
1998-02-15 5:00 ` Scott Collins
1998-02-18 5:00 ` Ernest LaBonte
@ 1998-02-26 5:00 ` mark vallee
2 siblings, 0 replies; 5+ messages in thread
From: mark vallee @ 1998-02-26 5:00 UTC (permalink / raw)
If you go to www.lexmark.com and look at there faq for network
they have a printcap for unix bsd system.But they have no print filters for
osf.
David S. Loose-Mitchell <dloose@farmr1.med.uth.tmc.edu> wrote in article
<34e62c84.38794455@news.uth.tmc.edu>...
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Help printing from Alpha to Lexmark RT
@ 1998-02-14 5:00 David S. Loose-Mitchell
0 siblings, 0 replies; 5+ messages in thread
From: David S. Loose-Mitchell @ 1998-02-14 5:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1998-02-26 5:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-02-14 5:00 Help printing from Alpha to Lexmark RT David S. Loose-Mitchell
1998-02-15 5:00 ` Scott Collins
1998-02-18 5:00 ` Ernest LaBonte
1998-02-26 5:00 ` mark vallee
-- strict thread matches above, loose matches on Subject: below --
1998-02-14 5:00 David S. Loose-Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox