Print configuration for a testing gateway

Configuring print services for our example testing gateway machine

Author: Francesco Poli
Contact: invernomuto@paranoici.org
Version: 0.7
Copyright: Expat license
Notice:

Copyright (c) 2012-2025 Francesco Poli

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About this document
Web form HyperText Markup Language
Source form reStructuredText
Web stylesheet Cascading StyleSheets
Build directives Makefile

Contents

  • Summary of previous episodes
  • Printing service
  • Local printers

Summary of previous episodes

In another document (HTML, reST) you saw how to configure basic network services on our example Debian testing gateway machine. Now another useful service may be enabled on the system: printing.

Printing service

First of all, install the printing system:

# aptitude install cups cups-bsd cups-client foomatic-db \
  avahi-daemon_ ipp-usb_ colord_ printer-driver-all_ cups-browsed_

and stop the service:

# systemctl stop cups.service

so that you may unhurriedly modify its configuration. Set A4 as the default paper size:

# cat /etc/papersize
a4

Then, edit the main configuration file so that:

# grep Browsing /etc/cups/cupsd.conf
Browsing No
# grep WebInterface /etc/cups/cupsd.conf
WebInterface No

and add the following line (after the IdleExitTimeout 60 directive):

# grep PreserveJobHistory /etc/cups/cupsd.conf
PreserveJobHistory No

Then enable the socket:

# mkdir /etc/systemd/system/cups.socket.d/
# cp -ai /usr/share/doc/cups-daemon/examples/cups-socket.localhost.conf /etc/systemd/system/cups.socket.d/
# systemctl daemon-reload
# systemctl restart cups.socket

Install a text to PostScript converter:

# aptitude install enscript

edit its configuration file so that:

# grep DefaultMedia /etc/enscript.cfg
DefaultMedia: A4

Local printers

Configure an HP LaserJet 1320 printer connected via USB cable. Search for the printer:

# lpinfo -v | grep usb
direct usb://HP/LaserJet%201320%20series?serial=00CNFW522KS9

and then for the PPD driver:

# lpinfo -m | grep 1320

Among the possible PPD drivers, choose:

# lpadmin -p lj -E \
  -v 'usb://HP/LaserJet%201320%20series?serial=00CNFW522KS9' \
  -m foomatic:HP-LaserJet_1320-pxlmono.ppd \
  -o pdftops-renderer-default=pdftops \
  -L local -D "HP LaserJet 1320"
# lpoptions -p lj -o media=A4 -o sides=two-sided-long-edge
# lpadmin -d lj