forked from pool/cups-backends
93 lines
4.0 KiB
Plaintext
93 lines
4.0 KiB
Plaintext
hpnpf A replacement backend for the CUPS socket backend
|
|
=========================================================
|
|
|
|
DESCRIPTION
|
|
|
|
This backend is based on HP's hpnpf utility (the sources of which have been freely
|
|
availabel until 1992) and has been extended to safely report the backchannel messages
|
|
from a JetDierect driven HP printer and - for PostScript printers only - to use
|
|
the TBCP (Tagged Binary Communications Protocol) as defined by Adobe.
|
|
|
|
The program can be run either as a CUPS backend or as a standalone utility, depending
|
|
on the name it is called by:
|
|
|
|
- if the name it is called with contains one of the strings '://' or 'backend/hpnpf'
|
|
(the latter for use with the CUPS backend test utility), it runs as a CUPS
|
|
backend, following the CUPS backend calling and input/output conventions.
|
|
- otherwise, it runs as a standalone utility and accepts additional switches.
|
|
|
|
|
|
INSTALLATION
|
|
|
|
Unzip and untar the file hpnpf.tgz into a suitable directory.
|
|
Within that directory, on SYSV UNIXes, run "make hpnpf", on Linux systems,
|
|
run "make -f linux.mak hpnpf". (Don't try to make hpnptyd, this won't succeed.)
|
|
On systems which do not/no longer support the good old varargs stuff but
|
|
require the use of the new stdarg approach for variable argument lists,
|
|
use
|
|
make -f linux_std.mak
|
|
or
|
|
make -f sysv_std.mak
|
|
for SYSV systems.
|
|
|
|
For CUPS use, copy the compiled binary hpnpf to the CUPS backend directory,
|
|
usually /usr/lib/cups/backend.
|
|
For standalone use, copy the binary to e.g. /usr/local/bin.
|
|
|
|
|
|
CUPS USAGE
|
|
|
|
When configuring a CUPS printer for using this backend, the URI syntyx is much the same
|
|
as for the standard socket backend:
|
|
hpnpf://printername:port
|
|
where port usually is 9100.
|
|
To enable TBCP, append the string "/TBCP" to the URI, as:
|
|
hpnpf://printername:port/TBCP
|
|
|
|
The backend writes information to a printer specific log file,
|
|
/var/log/cups/status_log.printername
|
|
For each job printed, an identification line like
|
|
INFO: [Mon Sep 11 11:08:08 2000] HPDIACOS.0001.SRZ0.11486.PS (1999)
|
|
containing the current date, the job ID (much like the standard backend) and the job number.
|
|
An info message like
|
|
INFO: Printing: HPDIACOS.0001.SRZ0.11486.PS
|
|
is written to stderr and thus captured by cupsd and available as status message.
|
|
Any PostScript error messages are logged like:
|
|
INFO: %%[ Error: rangecheck; OffendingCommand: getinterval ]%%
|
|
These errors are passed as info messages to cupsd as:
|
|
INFO: HPDIACOS.0001.SRZ0.11486.PS | %%[ Error: rangecheck; OffendingCommand: getinterval ]%%
|
|
and thus available as the printer's status message.
|
|
If no error occurred, a completion message is passed to cupsd like:
|
|
INFO: Printed: HPDIACOS.0001.SRZ0.11486.PS
|
|
|
|
For debugging, you may append "-D" to the device-URI. In this case, any PJL commands and replies
|
|
are logged to the printer specific status log file as specified above, and
|
|
debugging messages from hpnpf are written to /var/log/cups/printername.log.
|
|
|
|
|
|
STANDALONE USAGE
|
|
|
|
Called without any parameters the following usage message is printed to stderr:
|
|
|
|
usage: hpnpf -x periph [-c port] [-nNPrRSTvwW] [-p port] [-s statusfile] [-l logfile] file ...
|
|
-n (PLC only) map LF->CRLF, FF->CRFF
|
|
-N map LF->CRLF physically
|
|
-P (PostScript only) print banner page
|
|
-r run in relay mode
|
|
-R do no retries if connection fails
|
|
-S delete all CRs
|
|
-T (PostScript only) use TBCP (Tagged Binary Communcations Protocol)
|
|
-v verbose mode
|
|
-w wait for the job to be completed
|
|
-W as -w, additionally display all PJL commands and replies
|
|
-c port control port number (for relay mode only)
|
|
-x periph name or IP addr of printer
|
|
-p port port number to connect with
|
|
-s statusfile file to which status messages are written; default: stdout
|
|
-l logfile file to which logging messages are written (- : stderr)
|
|
file ... files to be printed; read from stdin if no files are given
|
|
|
|
The -w switch enables the logging of the PostScript messages, the -W switch additionally
|
|
logs the PJL commands and replies, -T enables the TBCP protocol. All other switches have the
|
|
same meaning as of the original hpnpf (but haven't been fully tested with this version).
|