Repository navigation
Printer Profiles
The relay needs a driver: a description of what your printer can do (paper, colour, two-sided) and how to send it pages. You can give it one in three ways. Most owners only need the first.
| Built-in template + profile | PPD_MODEL |
PPD_FILE |
|
|---|---|---|---|
| What it is | An MIT-licensed generic PostScript PPD, rendered at every start from a profile and your environment | A driver that ships inside the image, selected by its CUPS model name | Your own vendor PPD, mounted into the container read-only |
| For | PostScript printers (most networked office lasers of the era) | PCL-only printers, via the CUPS sample drivers | Vendor-specific features, or when nothing else fits |
| Colour and duplex come from |
COLOR and DUPLEX (profile or environment) |
The driver | The PPD, mistakes included |
| Start-up self-check covers | Paper size, PDF, queue shared and accepting, colour, duplex | Paper size, PDF, queue shared and accepting | Paper size, PDF, queue shared and accepting |
| Licence | MIT, part of this repository | Part of CUPS in the image | The vendor's. Never commit it. |
| Status | Tested (Xerox DocuPrint N17b reference printer, e2e suite) | Expected | Expected |
Tested means run on real hardware for printers and client devices (iPhone, iPad, Mac, Windows, Android), and exercised by the automated e2e suite or on real hardware for software behaviour. Expected means it should work by design but hasn't been validated yet, so reports are welcome on the Compatibility-List.
flowchart TD
start(["Your printer"]) --> ps{"Does it understand PostScript?"}
ps -->|"Not sure"| identify["Check the configuration page:<br/>Create-a-Printer-Profile, step 1"]
identify --> ps
ps -->|Yes| known{"Is there a built-in profile<br/>for your model?"}
known -->|Yes| useprof["PRINTER_PROFILE=that profile"]
known -->|No| generic["PRINTER_PROFILE=generic-postscript<br/>plus overrides, or create a profile"]
useprof --> vendor{"Need a vendor-only feature,<br/>such as a specific tray?"}
generic --> vendor
vendor -->|No| done(["Print a test page"])
vendor -->|Yes| ppdfile["PPD_FILE=/ppd/your-printer.ppd<br/>(mounted, never committed)"]
ps -->|"No, PCL only"| pcl["PPD_MODEL=drv:///sample.drv/laserjet.ppd"]
pcl --> works{"Prints correctly?"}
works -->|Yes| done
works -->|No| other["Try another model from lpinfo -m,<br/>or PPD_FILE"]
ppdfile --> done
other --> done
If the printer understands both PostScript and PCL, use PostScript with the built-in template: you get exact control over what iPhones are offered, and the self-check verifies all of it.
Set PRINTER_PROFILE to one of the built-in profiles:
| Profile | Printer | Settings | Status |
|---|---|---|---|
generic-postscript |
Any PostScript Level 2 (or later) network printer | mono, Level 2, 600 dpi, one-sided | Default in compose.yaml. Expected
|
xerox-docuprint-n17 |
Xerox DocuPrint N17 / N17b | mono, Level 2, 600 dpi, two-sided | Tested on the N17b (with duplex unit); Expected on the N17 without it |
The N17's duplex unit is optional hardware, so set DUPLEX=false if yours has none.
A profile only sets these model keys: MODEL_NAME, MANUFACTURER, LANGUAGE_LEVEL, RESOLUTION, COLOR and
DUPLEX (optionally PAGE_MARGIN). Any of them that you set in your own environment wins over the profile, and an
empty value counts as not set:
# .env: the generic profile, but for a colour Level 3 printer with a duplex unit
PRINTER_PROFILE=generic-postscript
LANGUAGE_LEVEL=3
COLOR=true
DUPLEX=true
MODEL_NAME=Acme Laser 9000
MANUFACTURER=AcmeThat's all you need to get printing. If you'd like the next owner of the same model to skip this step, turn those settings into a profile and contribute it: see Create-a-Printer-Profile, or let an AI coding agent do the legwork with the Agent-Guide-Printer-Profile.
Paper size is not part of a profile. It depends on what is in your tray, so you always set it yourself with
PAPER_SIZE (and EXTRA_PAPER_SIZES). See Paper-Size-and-iOS.
The file format, rules and contribution checklist are in profiles/README.md, and there is a commented starting point in profiles/_template.env.
For printers that don't speak PostScript, use a driver that is already in the image. List the available models inside a running relay:
docker exec <container> lpinfo -mThe useful ones for legacy lasers:
PPD_MODEL |
Driver | Status |
|---|---|---|
drv:///sample.drv/laserjet.ppd |
HP LaserJet Series PCL 4/5 | Expected |
drv:///sample.drv/generpcl.ppd |
Generic PCL Laser Printer | Expected |
drv:///sample.drv/generic.ppd |
Generic PostScript Printer (CUPS sample driver) | Expected, but the built-in template is the better choice |
# .env
PPD_MODEL=drv:///sample.drv/laserjet.ppd
MODEL_NAME=Acme Laser 9000MODEL_NAME is optional here, but it is still used as the model name in the AirPrint advertisement, so set it to
your printer's name. The driver decides colour and duplex, so COLOR and DUPLEX have no effect. iPhones are still
offered only your PAPER_SIZE, and the relay stops with a clear error if the driver doesn't offer that size.
Use your printer's own PPD when you need something the template doesn't offer, such as a specific input tray.
# compose.yaml: uncomment the ./ppd mount, then put the PPD in ./ppd/ next to compose.yaml
volumes:
- cups-state:/etc/cups
- cups-spool:/var/spool/cups
- ./ppd:/ppd:ro# .env
PPD_FILE=/ppd/your-printer.ppdBefore you rely on it:
-
The PPD is used as is, including its mistakes. For example, the Xerox DocuPrint N17 PPD declares
*ColorDevice: TRUEalthough the printer is a monochrome laser. With that PPD the relay advertises colour, so iPhones offer a colour option the printer can't deliver. The built-in template doesn't have this problem. -
Vendor filters usually aren't in the image. If the PPD contains
*cupsFilterlines, the program it names must exist inside the container. When it doesn't, usePPD_MODELinstead. -
The PPD must offer your
PAPER_SIZE. If it doesn't, the container stops withPAPER_SIZE '…' is not offered by this PPD (it offers: …). - Set only one of
PPD_FILEandPPD_MODEL. - While you're experimenting,
SELFCHECK=warnlets the container keep running when the self-check fails. Remove it once the self-check passes. - Never commit a vendor PPD to this repository or attach one to an issue. Most may not be redistributed.
Step-by-step instructions for both alternatives are at the end of Create-a-Printer-Profile.
- Create-a-Printer-Profile: identify your printer, build and test a profile, contribute it
- Agent-Guide-Printer-Profile: a ready-to-paste prompt for an AI coding agent
- Compatibility-List: printers people have tried
- Configuration-Reference: every environment variable
legacy-printer-airprint-relay · MIT License · Report an issue · Not affiliated with Apple, Xerox or Synology. AirPrint is a trademark of Apple Inc.