feat: Add Print Quality (hardware resolution / droplet mode) option with direct Canon Super Fine access #5

Closed
opened 2026-09-07 23:13:36 +01:00 by gronod · 0 comments
Owner

Summary

In TargetPrint, the Inspector sidebar currently provides an option for continuous-tone raster input resolution (Resolution, e.g. 300x300, 600x600 dpi). However, it does not provide a dedicated Print Quality option to control the physical hardware printing mode, print-head micro-stepping pass count, and droplet placement density (e.g., 4800×2400 or 9600×2400 dpi droplet grids).

This feature request adds a dedicated Print Quality dropdown to TargetPrint that directly exposes vendor-specific hardware quality levels—including direct, one-click access to Canon's highest Super Fine setting (the "notch higher" than High, traditionally hidden behind Canon's nested "Custom" slider dialog).


Investigation & Driver Architecture

1. Canon Quality Architecture (Canon_Pro9500_II_series_XPS.ppd)

Inspection of Canon OEM drivers on macOS/CUPS reveals three interrelated PPD options:

  1. *OpenUI *CNIJPrintMode2/Print Quality: PickOne:
    • 1/High: standard high quality preset (maps to notch 4)
    • 2/Standard: standard normal quality preset (maps to notch 3)
    • 3/Fast: high-speed draft preset (maps to notch 1)
    • 5/Custom: enables the custom quality slider
  2. *OpenUI *CNIJPrintQuality/Quality: PickOne and *CNIJPQualitySlider:
    The underlying 5-notch slider values:
    • Notch 5 (Code 0): Super Finethe "notch higher" than High (maximum pass count & micro-droplet density)
    • Notch 4 (Code 5): Fineused by the "High" preset
    • Notch 3 (Code 10): Normal (Fine)used by the "Standard" preset
    • Notch 2 (Code 15): Normal (Fast)
    • Notch 1 (Code 20): Fastused by the "Fast" preset

In Canon's standard GUI, accessing Super Fine requires an awkward two-step dance: selecting "Custom", clicking a separate button to open the sub-dialog, and dragging the slider to 5.

2. Epson Quality Architecture (Epson_XP_55_LPD.ppd)

Epson drivers use *OpenUI *EPIJ_Qual/Print Quality: PickOne:

  • 307/Best Quality: maximum droplet resolution
  • 305/Quality: high photo quality
  • 304/Fine: standard photo quality
  • 303/Normal: standard plain paper quality
  • 302/Economy: economy
  • 301/Fast Economy: draft

3. Generic / CUPS / HP Architecture

Standard PostScript and CUPS drivers use:

  • *cupsPrintQuality: 3/Draft, 4/Normal, 5/High
  • *PrintQuality: Draft, Normal, High, Photo

Proposed Solution

1. Direct Granular Exposure (No Nested Dialogs)

Instead of forcing users to navigate nested Custom → Slider menus, TargetPrint will directly present the available quality tiers in a clean, native Print Quality dropdown:

  • Canon: Super Fine (Notch 5), Fine (Notch 4 / High), Normal (Fine) (Notch 3 / Standard), Normal (Fast) (Notch 2), Fast (Notch 1)
  • Epson: Best Quality, Quality, Fine, Normal, Economy, Fast Economy, Draft
  • Generic/CUPS: High, Normal, Draft
  • Fallback: Auto (gracefully disabled when queue lacks PPD quality options)

2. Coordinated Multi-Key Driver Injection in PrintEngine

When Super Fine is selected for a Canon queue:
PrintEngine.applyOptionalPPDKeys automatically injects:

extras["CNIJPrintQuality"] = "0"
extras["CNIJPrintMode2"] = "5"      // Custom mode
extras["CNIJPQualitySlider"] = "5"  // Slider position 5

This informs the Canon CUPS filter (Raster2CanonIJ) that Custom mode is engaged at position 5, activating the highest hardware pass count and finest droplet placement.

Similarly, when Fine (High) is selected:

extras["CNIJPrintQuality"] = "5"
extras["CNIJPrintMode2"] = "1"
extras["CNIJPQualitySlider"] = "4"

3. Media Type Interaction

  • For photo media (e.g. Photo Paper Plus Glossy II, Pro Platinum, Pro Luster), Super Fine is fully active.
  • If a media type physically cannot support Super Fine (e.g. Plain Paper), the Canon filter internally clamps to the maximum supported tier for that media.

4. Job Serialization & Dual-Identity Resolution

  • Extend TargetJob.swift PrintSettings with optional printQuality: String?.
  • Allow specifying quality either by title ("Super Fine", "High") or choice code ("0", "1").

Implementation Tasks

  1. PPD Parsing (CUPSManager.swift):
    • Add qualityChoices: [PPDChoice] and qualityKeyword: String? to PPDOptions and PrinterQueue.
    • Implement discovery prioritizing CNIJPrintQuality / EPIJ_Qual / cupsPrintQuality / PrintQuality with *OpenUI fallback.
  2. Inspector Sidebar (InspectorView.swift):
    • Add qualityPop = NSPopUpButton() placed above resolutionPop.
    • Update refreshDependent(), apply(), and push() to bind engine.printQuality.
  3. Print Engine (PrintEngine.swift):
    • Update applyOptionalPPDKeys(to:queue:) with coordinated key injection for Canon (CNIJPrintQuality, CNIJPrintMode2, CNIJPQualitySlider) and Epson (EPIJ_Qual).
  4. TargetJob Model (TargetJob.swift):
    • Add printQuality to PrintSettings, parser, and serializer.
  5. Testing (Tests/PPDOptionsTests.swift, Tests/TestRunnerMain.swift):
    • Add test cases verifying Canon 5-notch parsing, multi-key injection for Super Fine, Epson EPIJ_Qual parsing, and TargetJob round-tripping.
### Summary In `TargetPrint`, the Inspector sidebar currently provides an option for continuous-tone raster input resolution (`Resolution`, e.g. `300x300`, `600x600 dpi`). However, it does not provide a dedicated **Print Quality** option to control the physical hardware printing mode, print-head micro-stepping pass count, and droplet placement density (e.g., 4800×2400 or 9600×2400 dpi droplet grids). This feature request adds a dedicated **Print Quality** dropdown to TargetPrint that directly exposes vendor-specific hardware quality levels—including direct, one-click access to Canon's highest **Super Fine** setting (the "notch higher" than High, traditionally hidden behind Canon's nested "Custom" slider dialog). --- ### Investigation & Driver Architecture #### 1. Canon Quality Architecture (`Canon_Pro9500_II_series_XPS.ppd`) Inspection of Canon OEM drivers on macOS/CUPS reveals three interrelated PPD options: 1. `*OpenUI *CNIJPrintMode2/Print Quality: PickOne`: - `1/High`: standard high quality preset (maps to notch 4) - `2/Standard`: standard normal quality preset (maps to notch 3) - `3/Fast`: high-speed draft preset (maps to notch 1) - `5/Custom`: enables the custom quality slider 2. `*OpenUI *CNIJPrintQuality/Quality: PickOne` and `*CNIJPQualitySlider`: The underlying 5-notch slider values: - **Notch 5 (Code `0`)**: **Super Fine** — *the "notch higher" than High (maximum pass count & micro-droplet density)* - **Notch 4 (Code `5`)**: **Fine** — *used by the "High" preset* - **Notch 3 (Code `10`)**: **Normal (Fine)** — *used by the "Standard" preset* - **Notch 2 (Code `15`)**: **Normal (Fast)** - **Notch 1 (Code `20`)**: **Fast** — *used by the "Fast" preset* In Canon's standard GUI, accessing **Super Fine** requires an awkward two-step dance: selecting "Custom", clicking a separate button to open the sub-dialog, and dragging the slider to 5. #### 2. Epson Quality Architecture (`Epson_XP_55_LPD.ppd`) Epson drivers use `*OpenUI *EPIJ_Qual/Print Quality: PickOne`: - `307/Best Quality`: maximum droplet resolution - `305/Quality`: high photo quality - `304/Fine`: standard photo quality - `303/Normal`: standard plain paper quality - `302/Economy`: economy - `301/Fast Economy`: draft #### 3. Generic / CUPS / HP Architecture Standard PostScript and CUPS drivers use: - `*cupsPrintQuality`: `3/Draft`, `4/Normal`, `5/High` - `*PrintQuality`: `Draft`, `Normal`, `High`, `Photo` --- ### Proposed Solution #### 1. Direct Granular Exposure (No Nested Dialogs) Instead of forcing users to navigate nested Custom → Slider menus, TargetPrint will directly present the available quality tiers in a clean, native **Print Quality** dropdown: - **Canon**: `Super Fine` (Notch 5), `Fine` (Notch 4 / High), `Normal (Fine)` (Notch 3 / Standard), `Normal (Fast)` (Notch 2), `Fast` (Notch 1) - **Epson**: `Best Quality`, `Quality`, `Fine`, `Normal`, `Economy`, `Fast Economy`, `Draft` - **Generic/CUPS**: `High`, `Normal`, `Draft` - **Fallback**: `Auto` (gracefully disabled when queue lacks PPD quality options) #### 2. Coordinated Multi-Key Driver Injection in `PrintEngine` When **Super Fine** is selected for a Canon queue: `PrintEngine.applyOptionalPPDKeys` automatically injects: ```swift extras["CNIJPrintQuality"] = "0" extras["CNIJPrintMode2"] = "5" // Custom mode extras["CNIJPQualitySlider"] = "5" // Slider position 5 ``` This informs the Canon CUPS filter (`Raster2CanonIJ`) that Custom mode is engaged at position 5, activating the highest hardware pass count and finest droplet placement. Similarly, when **Fine** (High) is selected: ```swift extras["CNIJPrintQuality"] = "5" extras["CNIJPrintMode2"] = "1" extras["CNIJPQualitySlider"] = "4" ``` #### 3. Media Type Interaction - For photo media (e.g. *Photo Paper Plus Glossy II*, *Pro Platinum*, *Pro Luster*), **Super Fine** is fully active. - If a media type physically cannot support Super Fine (e.g. *Plain Paper*), the Canon filter internally clamps to the maximum supported tier for that media. #### 4. Job Serialization & Dual-Identity Resolution - Extend `TargetJob.swift` `PrintSettings` with optional `printQuality: String?`. - Allow specifying quality either by title (`"Super Fine"`, `"High"`) or choice code (`"0"`, `"1"`). --- ### Implementation Tasks 1. **PPD Parsing (`CUPSManager.swift`)**: - Add `qualityChoices: [PPDChoice]` and `qualityKeyword: String?` to `PPDOptions` and `PrinterQueue`. - Implement discovery prioritizing `CNIJPrintQuality` / `EPIJ_Qual` / `cupsPrintQuality` / `PrintQuality` with `*OpenUI` fallback. 2. **Inspector Sidebar (`InspectorView.swift`)**: - Add `qualityPop = NSPopUpButton()` placed above `resolutionPop`. - Update `refreshDependent()`, `apply()`, and `push()` to bind `engine.printQuality`. 3. **Print Engine (`PrintEngine.swift`)**: - Update `applyOptionalPPDKeys(to:queue:)` with coordinated key injection for Canon (`CNIJPrintQuality`, `CNIJPrintMode2`, `CNIJPQualitySlider`) and Epson (`EPIJ_Qual`). 4. **TargetJob Model (`TargetJob.swift`)**: - Add `printQuality` to `PrintSettings`, parser, and serializer. 5. **Testing (`Tests/PPDOptionsTests.swift`, `Tests/TestRunnerMain.swift`)**: - Add test cases verifying Canon 5-notch parsing, multi-key injection for Super Fine, Epson `EPIJ_Qual` parsing, and TargetJob round-tripping.
gronod added the Kind/Feature label 2026-09-07 23:13:36 +01:00
Sign in to join this conversation.