mirror of
https://github.com/kfattic/cupsadmin.git
synced 2026-11-13 19:06:43 -05:00
Canon and HP driver profiles for quick actions
Canon: CNColorMode color/mono, CNDuplex, PageSize=Letter. HP: HPColorAsGray or HPColorMode; duplex and Letter from the generic profile. Profiles can mark an action unavailable with a reason (Canon department IDs, HP accounting codes). Use Letter Paper only says Fit to Nearest Size when the profile sets a fit option. Offline tests sweep every Canon and HP PPD found in CUPSKIT_PPD_DIRS or /Library/Printers/PPDs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
12
README.md
12
README.md
@@ -33,7 +33,7 @@ cupsadmin options <queue> # PPD options and IPP *-default values, like lp
|
||||
cupsadmin add <queue> -v <uri> [-m everywhere | -P file.ppd] [-D desc] [-L location] [--shared] [-o k=v ...]
|
||||
cupsadmin set <queue> -o k=v ... # change queue defaults, then read them back and report
|
||||
cupsadmin quick <action> <queue> [value] # task-named shortcuts, see below
|
||||
cupsadmin ppdreport <queue> # every PPD group and option: keyword, label, type, default, choices
|
||||
cupsadmin ppdreport <queue | file.ppd[.gz]> # every PPD group and option: keyword, label, type, default, choices
|
||||
```
|
||||
|
||||
Every run prints `started HH:MM:SS`, one status line (`OK: …` or `ERROR: …`) and `finished HH:MM:SS (total N min)` — on every exit path. Status lines go to stderr so table output pipes cleanly.
|
||||
@@ -50,7 +50,7 @@ cupsadmin quick bw <queue> # always print black & white
|
||||
cupsadmin quick usercode <queue> 12345 # set a Ricoh user code (enables it too)
|
||||
cupsadmin quick duplex <queue> # default to two-sided
|
||||
cupsadmin quick simplex <queue>
|
||||
cupsadmin quick letter <queue> # Letter paper + fit to nearest size (no "prompt user" at the printer)
|
||||
cupsadmin quick letter <queue> # Letter paper; also fit to nearest size where the driver can (Ricoh)
|
||||
cupsadmin quick default <queue> # make this the server default printer
|
||||
```
|
||||
|
||||
@@ -65,13 +65,15 @@ Which keywords an action writes comes from a driver profile (`Sources/CupsKit/Re
|
||||
| Ricoh M C251FW PS | ✓ color, black & white, duplex, Letter (no user code) |
|
||||
| Ricoh PCL (e.g. SP 3710DN) | ✓ duplex, Letter (generic) |
|
||||
| Any other PPD, IPP Everywhere / AirPrint | ✓ color, black & white, duplex, Letter where the queue supports them (generic) |
|
||||
| Canon, HP, Xerox, Konica Minolta user/department codes | no built-in profile — add one (below) |
|
||||
| Canon UFR II / LIPSLX / CARPS2 | ✓ color, black & white (color models), duplex, Letter (no fit-to-page option); department IDs are set in the Canon driver, not the PPD |
|
||||
| HP (`HPColorAsGray` or `HPColorMode` drivers) | ✓ color, black & white, duplex, Letter (no fit-to-page option); no accounting code option |
|
||||
| Xerox, Konica Minolta and others | generic only — add a profile (below) |
|
||||
|
||||
### Adding your printer's driver
|
||||
|
||||
1. `cupsadmin ppdreport <queue>` lists every option your driver has; find the color, duplex, paper and accounting/user-code keywords and their choice values.
|
||||
1. `cupsadmin ppdreport <queue>` (or `ppdreport <file.ppd.gz>` for a PPD from a driver package you haven't installed — `pkgutil --expand-full` it first) lists every option your driver has; find the color, duplex, paper and accounting/user-code keywords and their choice values.
|
||||
2. Copy the `ricoh` entry in `Sources/CupsKit/Resources/driver-profiles.json`, give it an `id`, and set `match` to regular expressions for your PPD's `Manufacturer` and `NickName` (both are printed at the top of the report).
|
||||
3. Replace the `keyword=value` pairs. `{value}` is the code the user types; typed options take `Custom.{value}`. Leave out actions your driver can't do. Keep your profile above `generic`.
|
||||
3. Replace the `keyword=value` pairs. `{value}` is the code the user types; typed options take `Custom.{value}`. Leave out actions your driver can't do, or explain why under `unavailable`. Keep your profile above `generic`.
|
||||
4. `swift build && .build/debug/cupsadmin ppdreport <queue>` shows which quick actions are now available; try one with `cupsadmin quick`, then open a pull request.
|
||||
|
||||
## How it works
|
||||
|
||||
Reference in New Issue
Block a user