fpfilter(1) DG/UX R4.11 fpfilter(1)
NAME
fpfilter, parfilter, pardfilter, pspardfilter, serfilter, serdfilter,
pspsrdfilter - send files to MiLAN fastport and print on serial or
parallel printer
SYNOPSIS
fpfilter [ -P printer_name ] [ -p1 | -p2 | -s1 | -s2 | -s | -dataport
port ] [ -b ] [ -f ] [ -m ] [ -p ] [ -D ] [ -A filename ] [ -d ] [
-startfile filename ] [ -endfile filename ] [ -startstring string ] [
-endstring string ] [ -syslog ] [ -mail user-name ] [ -errorfile
filename ] [ -prog program-name ] [ -P_CLASS printer-names ] [
-S_CLASS printer-names ] [ -closewait ] files
DESCRIPTION
These filter commands send files across an ethernet network to a
MiLAN fastport, which sends the data to the appropriate printer
connected to it. They work on any system that supports standard
TCP/IP socket calls. The filter programs connect to a fastport,
reads the files from the command line (if called directly) or from
the spool directory (if called from the lpr or lp command).
Before installing the filters, setup your fastport. Place its
ethernet address into the /etc/ethers file, and configure its IP
address either through an rarp server or by explicitly setting it in
the fastport monitor (please refer the manual for more details and
examples). Then follow the procedure specified in the manual for
installing the software.
To print ASCII files on a PostScript printer, one needs to specify an
ASCII to PostScript conversion program. One such public domain
program a2ps is supplied with the host software in the examples/a2ps
directory. This can be used to convert the ASCII file to PostScript
before sending it to the printer.
The installation script creates several files such as serdfilter,
psserdfilter, pspardfilter, and pardfilter, which are symbolic links
to the program fpfilter in the installation directory. The ser
prefix indicates that the job is to be sent to the serial port, while
the par prefix in these filters indicates that the jobs should be
sent to the parallel printer. By default, the jobs are sent to the
parallel port. PostScript printers normally like a Ctrl-D after the
print jobs are sent. The d in the filter programs indicates that
such a character should be sent after the jobs. Hence psserdfilter
can be used to send print jobs to PostScript printers connected to
the serial port. serdfilter sends jobs to any printer connected to
the serial port. Similarly parfilter sends print jobs to a printer
connected to the parallel port on the fastport. These filters use
argv[0] (the name it was invoked under) to determine what action to
take.
.fpconfig File
Fpfilter can be configured through a .fpconfig in the current working
directory when fpfilter runs. When using lpd, the current working
directory is set to be the spool directory for requests that have
been submitted through lpr. The syntax for the .fpconfig file is
given below. Any number of the entries can appear.
hostname name
Specifies the IP name for the fastport.
serial Send to the serial port ( Model 3100 ).
serial1 Send to serial port 1.
serial2 Send to serial port 2.
parallel Send to the parallel port ( Model 3100).
parallel1 Send to parallel port 1.
parallel2 Send to parallel port 2.
dataport port
Send to tcp/ip port number port.
ctrld Send a Ctrl-D before and after the job.
formfeed Send a formfeed after the job.
mapcrlf Map line feeds to carriage return/line feeds.
asciifilter program
Call program if the file is ASCII.
dobanner Look for file .banner in the current working directory and
submit it before the job. (Note: .banner is typically
generated by the printcap output (of) filter).
startfile file
Send file before the job (this can be used to download the
PostScript error handler for example).
endfile file
Send file after the job.
startstring string
Send string before the job (this can be used to set printer
modes--i.e., send escape sequences).
endstring string
Send string after the job.
P_CLASS List of names of the parallel printers.
S_CLASS List of names of serial printers.
The filter program maintains a list of printers formed in
the following order. The first printer is the one
specified on the command line (if one is given). The next
printer in the list is the one specified against hostname
in the .fpconfig file. The subsequent ones are derived
from the P_CLASS and S_CLASS lists. You can specify any
number of such entries.
The filter program tries to connect to the first printer in
the list. If it is unable to do so within 10 seconds (this
may happen because the printer was busy or it was down,
etc.), it will try to connect to the next printer. If all
the printers are exhausted, the filter will try once again
starting from the first printer in the list.
mail username
Send a mail message to the user after the job is printed OR
in case of an error.
program progname
Execute progname after the job is printed or in case of an
error.
errorfile filename
Store the errors messages in the file called filename.
syslog Record error messages in syslog file.
checkserial
Sends a Control+T to check the serial printer's status
before sending a print job. Applies only to PostScript
pritners. If no printer is attached no data is sent.
checkparallel
Checks for the parallel printer before sending a print job.
Certain parallel printers do not make the parallel status
BUSY when they are turned off. If a FastPort in standard
mode continues to send jobs, then these jobs are lost if
this option is not used for these printers.
acctg Log the name of user, host, file, date and time in the
logfile.
closewait Wait until all data is sent from the socket before closing
connection.
If both the startstring and startfile are specified, then the
startfile is sent first. Similarly, the endfile is sent before the
endstring.
The syntax for escape is:
M-
and control:
C^
So, a line that would set an hpIIIsi to landscape mode when in pcl
mode might be:
startstring "M-&l1O"
Quotes ("') can be omitted if desired.
Using the .fpconfig file, one can set the printer mode, execute
commands after printing, get notifications regarding the print jobs
etc. If you do not want to place the .fpconfig file in the spool
directory OR want to call it by some other name, then you can use the
following command.
setenv PRINTER_CONFIG complete_path_including_filename_of_config_file
for the C-Shell, or
PRINTER_CONFIG=complete_path_including_filename_of_config_file;
export PRINTER_CONFIG
for the Bourne shell.
Options
The command line options supported by fpfilter are the following:
-P printer_name
To specify the name given to the printer attached to the
fastport.
-p1 Send data to parallel port 1.
-p2 Send data to parallel port 2.
-s1 Send data to serial port 1.
-s2 Send data to serial port 2.
-s Send data to the MiLAN 3100 serial port. By default, data is
sent to the MiLAN 3100 parallel port.
-dataport port
Send data to the port specified by the tcp/ip port number.
-b Send a .banner file in either the spool directory (for lp
command) or from the current directory before sending any print
job. This is helpful in setting up printer options.
-f Send a final form feed. If the pages of text to be printed are
only partially full, use this option.
-m HP Laserjet uses CR/LFs while UNIX commonly sends only LFs as
the end of line terminators. Use this option to ask the
communication filter to perform the CR/LF mappings.
-D Specify the directory in which the printer configuration file
.fpconfig is present. This file contains the commands that can
be used to set printer options. Default is current directory
and the printer spool directory.
-A filename
Specify with complete path the ASCII to PostScript conversion
program.
-d Send a Ctrl-D to terminate print jobs. This may be required for
PostScript printers.
-startfile filename
Specify the file that is always printed before any print job.
You can specify some header file here.
-endfile filename
Specify the file that will always be printed at the end of a
print job. You can specify some trailer file here.
-startstring string
Specify the string that will always be sent before any print job
is sent. This can be used to set the printer mode etc.
-endstring string
Specify the string that will be sent at the end of a job. This
can be used to reset the printer to its original mode.
-syslog
Print the error messages into the syslog file.
-mail user-name
Send mail to the user-name after the job is printed.
-prog program-name
Execute the program program-name after the completion of print
job.
-errorfile filename
Store the error messages into the filename.
-P_CLASS printer-names
Try to print jobs on the parallel printers specified in printer-
names.
-S_CLASS printer-names
Try to print jobs on the serial printers specified in printer-
names. It tries to connect for 10 seconds to each printer and
if unsuccessful, it goes to the next printer in the list.
-p Print PostScript file.
-closewait
Wait until all data is sent from the socket before closing
connection
Usage
fpfilter is a communication filter designed to print on both the
serial and parallel ports on the MiLAN fastport. This program can be
used directly on the command line or can be used as a filter for the
lpr and lp commands.
SEE ALSO
fastport(1), fpstatus(1), lp(1), lpr(1), lpd(1M),
printcap(5).
Fastport Network Print Server User Manual
Licensed material--property of copyright holder(s)