$OpenBSD: README,v 1.3 2014/02/08 18:01:00 ajacoutot Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

lpd(8) using direct printing with foomatic-rip(1)
=================================================

The Foomatic framework supports direct printing which does not rely on
CUPS (nor any spooler) and can thus be used with lpd(8).

Complete documentation can be found at:
    http://www.linuxfoundation.org/collaborate/workgroups/openprinting/database/nospoolerdocumentation

Configuration
-------------
A specific PPD file has to be created for the printer. Refer to the
documentation that comes with the foomatic-db-engine package to learn
how to generate PPD files
(cf. ${LOCALBASE}/share/doc/pkg-readmes/foomatic-db-engine-*).

# mkdir -p /etc/foomatic/direct
# foomatic-ppdfile -p 'Samsung-ML-2850D' -d 'Postscript' > /etc/foomatic/direct/samsung-ml2850d.ppd

Non-postscript files can be printed after having been pre-processed and
converted. Several packages can be used for that, a2ps being the most
complete.
Here's a sample pre-process filter script:

---8<-------------------------------------------------------------------
#!/bin/sh

${LOCALBASE}/bin/a2ps -BRq --columns=1 -o - | \
	${PREFIX}/bin/foomatic-rip -P samsung-ml2850d
---8<-------------------------------------------------------------------

Additional options can be passed to foomatic-rip(1).
e.g.
- to print in duplex mode: -o duplex
- to set the page size to letter: -o pagesize=letter

a2ps(1) requires external helper tools for converting files, they can be
configured under ${SYSCONFDIR}/a2ps{,-site}.cfg.
By default, converting images requires the ImageMagick package.

To use the pre-process filter script as an input filter for lpd(8), the
corresponding printcap(5) entry can be used:

Locally connected printer (USB)
-------------------------------
lp|samsung|Samsung-ML-2850D:\
	:lp=/dev/ulpt0:\
	:if=/path/to/pre-process.sh:\
	:sd=/var/spool/output:\
	:lf=/var/log/lpd-errs:\
	:sh:

Network printer
---------------
rp|samsung|Samsung-ML-2850D:\
	:lp=515@1.2.3.4:\
	:if=/path/to/pre-process.sh:\
	:sd=/var/spool/output:\
	:lf=/var/log/lpd-errs:\
	:sh:
(where 1.2.3.4 is the printer IP address and 515 the spooler port)
