**Contents** [[!toc]] # Introduction The NetBSD guide contains a chapter on [printing](http://www.NetBSD.org/docs/guide/en/chap-print.html). The basic parts of this printing system are the line printer spooler daemon known as [[!template id=man name="lpd" section="8"]] and the associated tools such as [[!template id=man name="lpr" section="1"]]. Practically all printer-specific configuration is done with a special [[!template id=man name="printcap" section="5"]] database. This guide will not replicate the information presented in the official guide, but instead tries to offer some examples on how this printing system can be configured with modern printers. # Alternatives It appears that the _Common Unix Printing System_ (CUPS) has gradually replaced other more traditional printing systems (see also [[How_to_setup_CUPS_in_NetBSD]]). However, there is still room for [[!template id=man name="lpd" section="8"]] and friends. If not for anything else, CUPS is relatively complex piece of software with quite bad security record. Some prefer also to always use tools that come with an operating system instead of relying on external packages. Configuring and using a printer with [[!template id=man name="lpd" section="8"]] can be easier than with CUPS, once you wrap your head around it. # Example: HP DeskJet The following steps were needed for a low-cost HP DeskJet printer. First two packages were installed: [print/hpijs](http://pkgsrc.se/print/hpijs) and [print/foomatic-filters](http://pkgsrc.se/print/foomatic-filters): cd /usr/pkgsrc/print/hpijs make install package clean cd ../foomatic-filters make install package clean The former is essential for high-quality output with HP printers and the latter is convenient. The [print/hpijs](http://pkgsrc.se/print/hpijs)-package contains various _.ppd_-files compressed with [[!template id=man name="bzip" section="1"]]. You need to pick one suitable for your printer and unpack it to a desired location. An example: mkdir /etc/print cd /etc/print cp /usr/pkg/share/ppd/HP-DeskJet_5550-hpijs.ppd.gz . gunzip *.gz The next step is to configure the printer using the _/etc/printcap_ file. An example that uses parallel port: # This requires the following packages: # print/hpijs and print/foomatic-filters. # lp|hp|HP Deskjet 5550:\ :lp=/dev/lpt0:\ :af=/etc/print/HP-DeskJet_5550-hpijs.ppd:\ :if=/usr/pkg/bin/foomatic-rip:\ :sd=/var/spool/output/lpd:\ :lf=/var/log/lpd-errs:\ :rg=print:\ :rs=true:\ :sh: This will use the mentioned filter. The curiously named _foomatic_ Perl script takes PostScript as standard input and generates the printer's [page description language](http://en.wikipedia.org/wiki/Page_description_language) as standard output. This is pretty much all that is needed. For additional parameters in the configuration file, such as limiting the access to a group named _print_, please refer to the manual page, [[!template id=man name="printcap" section="5"]]. The final step is to enable the [[!template id=man name="lpd" section="8"]] daemon. The usual conventions with [[!template id=man name="rc.conf" section="5"]] apply: lpd=YES lpd_flags="-s" The _-s_ flag tells the daemon to use UNIX domain socket instead of listening on all interfaces. This is probably a good idea if you are not configuring a printing server (in which case you probably already know what you are doing). After starting the daemon you should be able to print files from the command line using the [[!template id=man name="lpr" section="1"]]. Printing from GUIs should also work. At least [print/xpdf](http://pkgsrc.se/print/xpdf) and [www/firefox3](http://pkgsrc.se/www/firefox3) were both capable of printing. # Example: HP LaserJet & network Before start you have to enable printer daemon in _rc.conf_ file, set: lpd=YES To enable printing for HP Laser Jet network printers add into _/etc/printcap_ following: # HP-4250 HP-4250:\ :lp=:sh:sd=/var/spool/lpd/lp:\ :rm=192.168.170.193:\ :lf=/var/log/lpd-errs:mx#0: Where: HP-4250 is basic name of your printer which you can change per desire. Instead of 192.168.170.193 you should set IP address of your printer. Check and create directory path if needed. # See also * [Printing](http://netbsd.org/docs/guide/en/chap-print.html#chap-print-remote) * [Sumsing ML-1640](http://wiki.netbsd.se/Samsung_ML-1640_and_NetBSD) * [Cups](http://wiki.netbsd.se/How_to_setup_CUPS_in_NetBSD) * [Other](http://mail-index.netbsd.org/netbsd-users/1997/07/23/0002.html)