# Remote printer must use jetdirect since foomatic-rip doesn't speak LPD
rp|HL-5250DN:\
:lp=9100@192.168.3.15:\
:if=/etc/foomatic-rip/script_brother.sh:\
:sh:sd=/var/spool/output/brother:\
:lf=/var/log/lpd-errs:
#!/bin/sh
/usr/local/bin/a2ps -BRq --columns=1 -o - | \
/usr/local/bin/foomatic-rip -P HL-5250DN --ppd /etc/foomatic-rip/direct/brother-hl-5250dn-postscript-brother.ppd
# Sample remote printer. The physical printer is on machine "lphost".
# You can perform any kind of local filtering directly. If you need
# local filters (e.g. LF -> CR-LF conversion for HP printers), create
# a filter script that sends the proper escape sequence to the printer
# and then concatenates stdin to stdout.
#
#
#remote|sample remote printer:\
lp:\
:lp=:rm=printer2:rp=raw:\
:sh:\
:mx#0:\
:sd=/var/spool/lpd/lp:\
:lf=/var/log/lpd-errs:
#
service lpd start
root@test-bsd:/usr/home/nedry # service lpd start
Starting lpd.
chkprintcap: Warning: new entry starts after line with trailing '\', at line 46 (entry lp)
chkprintcap: Warning: new entry starts after line with trailing '\', at line 47 (entry )
chkprintcap: Warning: new entry starts after line with trailing '\', at line 48 (entry )
chkprintcap: Warning: new entry starts after line with trailing '\', at line 49 (entry )
chkprintcap: Warning: new entry starts after line with trailing '\', at line 50 (entry )
chkprintcap: Warning: new entry starts after line with trailing '\', at line 51 (entry )
chkprintcap: 6 warnings from skimming /etc/printcap
chkprintcap: WARNING: found 6 entries when skimming /etc/printcap,
chkprintcap: WARNING: but only found 0 queues to process!
root@test-bsd:/usr/home/nedry #
Network
For a printer supporting the LPD protocol:
:lp=:rm=network-printer-name:rp=raw:\
For printers supporting port 9100 printing:
:lp=9100@network-printer-name:\
For both types, replace network-printer-name with the DNS host name of the network printer.
But that is not what you file is saying. Your file is saying when I remove \ from lp:\ the following:lp=:rm=network-printer-name:rp=raw:\
Replace network-printer-name with the DNS host name of the network printer.
lp::lp=:rm=printer2:rp=raw:\
lp=:rm=printer2:rp=raw:\
lp:\
:
lp:\
:lp=<whatever>
lp:\
:lp=:\
:sh:\
:mx#0:\
:rm=192.168.1.50:\
:rp=raw:\
:sd=/var/spool/lpd/lp:\
:lf=/var/log/lpd-errs:
something\
something else
The /etc/printcap file uses tercmap(5) format. As such, each entry describing a printer starts with a name, or set of names for the printer being described by the corresponding set of attributes.Actually, just checked and yup, it works for me with what the handbook and wonkity.com say, even though, as you point out, it should actually result in lp::lp and so on.
I guess the thing that can be a little confusing here is that 'lp' happens to be the name of an attribute, as well as the name of the default printer being used if noEntries in termcap consist of a number of `:'-separated fields. The first entry for each terminal gives the names that are known for the terminal, separated by `|' characters. The first name given is the most common abbreviation for the terminal. The last name given should be a long name fully identifying the terminal, and all others are understood as synonyms for the terminal name. All names but the last should be in lower case and contain no blanks; the last name may well contain upper case characters and blanks for readability.
PRINTER
environment variable is set, as stated in printcap(5):If I remember it correctly, the JetDirect module supports a number of different functions when used in lpd mode, depending on the remote printer (rp) attribute. WithThe default printer is normally lp, though the environment variable PRINTER may be used to override this. Each spooling utility supports an option, -P printer, to allow explicit naming of a destination printer.
rp=auto
the JetDirect module should be able to auto detect postscript and possibly also different end-of-line conventions (NL/CR/CRLF). Here's what I've used with a Postscript capable LaserJet 4+ printer:lj4p_raw|HP Laserjet 4 Plus, Raw Mode:\
:sh:lp=:\
:rm=druecker:rp=raw:\
:sd=/var/spool/output/lj4p_raw:\
:lf=/var/log/lpd-errs:
lj4p_text|lp|HP Laserjet 4 Plus, Text Mode:\
:sh:lp=:\
:rm=druecker:rp=text:\
:sd=/var/spool/output/lj4p_text:\
:lf=/var/log/lpd-errs:
lj4p_auto|HP Laserjet 4 Plus, Auto Mode:\
:sh:lp=:\
:rm=druecker:rp=auto:\
:sd=/var/spool/output/lj4p_auto:\
:lf=/var/log/lpd-errs:
lj4p_binps|HP Laserjet 4 Plus, Binary Postscript Mode:\
:sh:lp=:\
:rm=druecker:rp=binps:\
:sd=/var/spool/output/lj4p_binps:\
:lf=/var/log/lpd-errs:
The documention for my HP JetDirect 400n does not list the 'binps' (binary PostScript) queue, but the documentation of a HP JetDirect 680n does, so there are indeed slight differences with different JetDirect models. The support DVD even seems to include a Solaris utility that could be used to modify the queues on the JetDirect module.Which queue names are supported could vary depending on the model, but I'd suggest using raw and doing all the processing on the computer. That avoids possible surprises with what the JetDirect might do. I do not recall the binps stuff at all and suspect that the JetDirect just treats that as a raw queue because because it is not one of the special queue names.
Step 2. Setting Up Print Queues
You must set up a print queue for each printer or printer personality
(PCL or PostScript) you use on your system. Also, different queues
are required for formatted and unformatted files. The queue names
text and raw in the following examples (see rp tag) have special
meanings.
Table 4.2 Supported Queue Names
raw, raw1, raw2, raw3 no processing
text, text1, text2, text3 carriage return added
auto, auto1, auto2, auto3 automatic
The line printer daemon on the HP JetDirect print server treats
data in the text queue as unformatted text or ASCII, and adds a
carriage return to each line before sending it to the printer. (Note
that the actual observed behavior is that a PCL line termination
command (value of 2) is issued at the beginning of the job.) The line
printer daemon treats data in the raw queue as formatted files in
PCL, PostScript, or HP-GL/2 languages and sends the data without
change to the printer. Data in the auto queue will be automatically
processed as text or raw, as appropriate. If the queue name is not
one of the above, the HP JetDirect print server assumes it to be
raw1.
LPD on UNIX Systems
Configuring Print Queues for BSD-based Systems
Edit the /etc/printcap file to include the following entries:
printer_name|short_printer_name:\
:lp=:\
:rm=node_name:\
:rp=remote_printer_name_argument:\ (this should be
text, raw, or auto)
:lf=/usr/spool/lpd/error_log_filename:\
:sd=/usr/spool/lpd/printer_name:
where printer_name identifies the printer to the user,
node_name identifies the printer on the network, and
remote_printer_name_argument is the print queue
designation.
Hello I have a HP Laserjet 2420 printer with a network card connected and configured for LPR. Is there a tool or tutorial on how to configure freebsd 11 to do LPR printing?
thanks
nedry
pkg install cups
#enable cups in rc.conf via vi or append
sudo echo "cupsd_enable=yes" >> /etc/rc.conf
#Start cups daemon
sudo service cupsd start
#Enable Remote Admin ***Note you will probably want to
# disable remote configuration after configuration is complete.***
cupsctl --remote-admin
#Now you should be able to install and configure the printer via web interface.
http://127.0.0.1:631