44. Setting up Printing Services
Introduction to FreeBSD

There are three steps to setting up printing services:

  1. Edit the /etc/printcap and make an entry for the printer.

  2. Create a spool directory for lpd to store print jobs in.

  3. Start the line printer daemonlpd

Information about what printers are available to print from is contained in the file /etc/printcap. FreeBSD can print to printers connected to any valid port on the server, both parallel and serial. It can also print to any TCP/IP capable printer, such as those attached to other FreeBSD Boxes, and those attached to network printing devices, like Jet Direct cards.

Here is the standard /etc/printcap file:

#	@(#)printcap	5.3 (Berkeley) 6/30/90
# $Id: printing.docb,v 1.1.1.1 1999/04/03 19:28:04 chrisc Exp $

#
# This enables a simple local "raw" printer, hooked up to the first
# parallel port.  No kind of filtering is done, so everything you
# pass to the "lpr" command will be printed unmodified.
#
# Remember, for further print queues you're going to add, you have to
# chose different spool directories (the "sd" capability below),
# otherwise you will greatly confuse lpd.
#
# For some advanced printing, have a look at the "apsfilter" package.
# It plugs into the lpd system, allowing you to print a variety of
# different file types by converting everything to PostScript(tm)
# format.  If you don't have a PostScript(tm) printer, don't panic,
# but do also install the "ghostscript" package.
#
# Do also refer to section 7 (Printing) of the handbook.  A local copy
# can be found under /usr/share/doc/handbook/handbook.{html,latin1}.
#
lp|local line printer:\
	:lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
#
# Sample remote printer.  The physical printer is on machine "lphost".
# NB: you cannot 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 recursively calls lpd with another -P
# argument after filtering.
#
#remote|sample remote printer:\
#	:rm=lphost:sd=/var/spool/output/lphost:lf=/var/log/lpd-errs:

The line

lp|local line printer:\
	:lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:

from the above file, enables the default generic printer attached to /dev/lpt0. (Same as LPT1 on DOS systems)

For a printer to print, it needs a spool directory, or a place to temporarily store the file it is printing. This is sometimes called a queue; a print queue. When a print job is sent, but cannot be printed, it will be placed in this directory as a file. As soon as the printer is available, it will be sent to the printer. The spool directory in the example above is /var/spool/output/lpd

Note:

Post script printers are just like regular printers. Nothing special is required to set them up. Setting up a Non-post script printer to accept post script documents requires the a2ps or apsfilter package from the ports/packages collection

Also reference the man pages for: lpdlprlpcpr

Return to Table of Contents

Visit the Gifcom