Printing (Topic 1.107)

Objective 2: Manage Printers and Print Queues

  • Printers are assigned to queues, which are managed by lpd, the print daemon. lpd listens for inbound print requests, forking a copy of itself for each active print queue.

  • lpr submits jobs to print queues.

  • lpq queries and displays queue status.

  • lprm allows jobs to be removed from print queues.

  • lpc allows root to administer queues; it has both interactive and command-line forms.

  • Filters translate data formats into a printer definition language.

  • Spool directories hold spooled job data.

Objective 3: Print Files

  • Files are printed with the lpr command:

    # lpr /etc/lilo.conf
    # man -t 5 myfile.txt | lpr -Pqueue2

Objective 4: Install and Configure Local and Remote Printers

/etc/printcap

  • New printer definitions are added to /etc/printcap:

    lp|ljet:
            :sd=/var/spool/lpd/lp:
            :mx#0:
            :sh:
            :lp=/dev/lp0:
            :if=/var/spool/lpd/lp/filter:
            :lf=/var/spool/lpd/lp/log:

    The lines in this example are defined as follows:

    lp|ljet:

    This parameter defines two alternate names for the printer, lp or ljet.

    sd= spool_directory

    This parameter specifies the spool directory, under /var/spool/lpd.

    mx= max_size

    The maximum size of a print job in blocks. Setting this to #0 indicates no limit.

    sh

    Suppress header pages. Placing this attribute in printcap sets it, eliminating the headers.

    lp= printer_device

    The local printer device, such as a parallel port.

    if= input_filter

    The input filter to be used. See "Filters" in Chapter 15 for additional information.

    lf= log_file

    The file where error messages are logged.

Filters

  • APSfilter is implemented as executable scripts. Installation configures /etc/printcap automatically. Multiple queues may be defined to give the user access to specific printer capabilities.

  • Magicfilter is a binary program; installation does not automatically create print queues.

Remote queues and Samba printers

  • Printing on a remote system or network printer is done through a local queue. /etc/printcap for the local queue looks something like this:

    rlp:
            :sd=/var/spool/lpd/rlp:
            :rm=lphost:
            :rp=rlp:
            :mx#0:
            :sh:
            :if=/usr/local/bin/magicfilter 
     
    :
  • Printing to Windows printers is similar and uses the smbprint filter:

    winpr:
            :sd=/var/spool/lpd/winpr:
            :mx#0:
            :sh:
            :if=/usr/bin/smbprint:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset