feat(print): Enhanced Print Target Settings & Auto-Fitting Scaler (#34) #35

Merged
gronod merged 12 commits from feature/issue-34-enhanced-print-settings into development 2026-08-23 22:01:57 +01:00
Owner

Summary of Changes

This Pull Request addresses and resolves #34 by introducing native printer driver preference configuration, physical media tray selection, orientation switches, and an automatic behind-the-scenes layout fit scaler to the Stage 2: Print Layout & Direct Native Raw Printing panel.


Key Implementations

  1. Native Printer Driver Properties Dialog (show_printer_properties):

    • Windows: Invokes Win32 DocumentPropertiesW modally with DM_IN_PROMPT | DM_IN_BUFFER | DM_OUT_BUFFER to present the native OEM printer driver setup dialog, retaining customized DEVMODEW settings in backend session memory (PrinterDevModeStore).
    • Enables users to configure hardware-specific features (e.g. disabling color management like Epson "No Color Adjustment" / Canon "Off", media type, platen gap, vacuum intensity).
  2. Media & Page Setup Controls (get_printer_capabilities):

    • Paper Source / Tray Selector: Dynamically queries supported paper trays (DeviceCapabilitiesW DC_BINS/DC_BINNAMES on Windows; CUPS InputSlot via lpoptions on Unix).
    • Orientation Toggle Buttons: Allows toggling between Portrait and Landscape orientation (dmOrientation / -o orientation-requested=3/4).
  3. Behind-the-Scenes Automatic Page-Fit Scaler:

    • Replaces the manual DPI dropdown in Stage 2 with an automatic, intelligent fit engine.
    • Computes physical device metrics (HORZRES, VERTRES, LOGPIXELSX, LOGPIXELSY) to scale target TIFFs proportionally to fit 100% of the device's physical printable bounds without patch clipping or aspect ratio distortion.
    • Preserves strict color management bypass (SetICMMode(hdc, ICM_OFF) & raw passthrough).
  4. Automated & Unit Tests:

    • Added unit tests for PrinterCapabilities, PrintOptions, and PrinterDevModeStore.
    • Tested CUPS lpoptions parsing and argument building with orientation/media options.
    • Tested proportional fit scaler math (verifying bounded dimensions and centering).

Related Issue

Closes #34

### Summary of Changes This Pull Request addresses and resolves **#34** by introducing native printer driver preference configuration, physical media tray selection, orientation switches, and an automatic behind-the-scenes layout fit scaler to the **Stage 2: Print Layout & Direct Native Raw Printing** panel. --- ### Key Implementations 1. **Native Printer Driver Properties Dialog (`show_printer_properties`):** - **Windows:** Invokes Win32 `DocumentPropertiesW` modally with `DM_IN_PROMPT | DM_IN_BUFFER | DM_OUT_BUFFER` to present the native OEM printer driver setup dialog, retaining customized `DEVMODEW` settings in backend session memory (`PrinterDevModeStore`). - Enables users to configure hardware-specific features (e.g. disabling color management like Epson "No Color Adjustment" / Canon "Off", media type, platen gap, vacuum intensity). 2. **Media & Page Setup Controls (`get_printer_capabilities`):** - **Paper Source / Tray Selector:** Dynamically queries supported paper trays (`DeviceCapabilitiesW` `DC_BINS`/`DC_BINNAMES` on Windows; CUPS `InputSlot` via `lpoptions` on Unix). - **Orientation Toggle Buttons:** Allows toggling between **Portrait** and **Landscape** orientation (`dmOrientation` / `-o orientation-requested=3/4`). 3. **Behind-the-Scenes Automatic Page-Fit Scaler:** - Replaces the manual DPI dropdown in Stage 2 with an automatic, intelligent fit engine. - Computes physical device metrics (`HORZRES`, `VERTRES`, `LOGPIXELSX`, `LOGPIXELSY`) to scale target TIFFs proportionally to fit 100% of the device's physical printable bounds without patch clipping or aspect ratio distortion. - Preserves strict color management bypass (`SetICMMode(hdc, ICM_OFF)` & raw passthrough). 4. **Automated & Unit Tests:** - Added unit tests for `PrinterCapabilities`, `PrintOptions`, and `PrinterDevModeStore`. - Tested CUPS `lpoptions` parsing and argument building with orientation/media options. - Tested proportional fit scaler math (verifying bounded dimensions and centering). --- ### Related Issue Closes #34
gronod added 1 commit 2026-08-23 21:01:16 +01:00
feat(print): Enhanced Print Target Settings (Driver Preferences, Media Source, Orientation & Auto-Fitting Scaler) (closes #34)
Build Linux Packages / Build Linux (pull_request) Successful in 13m0s
Build Windows Packages / Build Windows (pull_request) Failing after 2m53s
963be50079
gronod added 1 commit 2026-08-23 21:36:03 +01:00
fix(ci): update build-windows workflow for host runner and pwsh
Build Linux Packages / Build Linux (pull_request) Successful in 19m52s
afbd4ad834
gronod added 1 commit 2026-08-23 21:36:26 +01:00
fix(print): enable unix module for test configurations
Build Linux Packages / Build Linux (pull_request) Failing after 12m22s
9febb5b552
gronod added 1 commit 2026-08-23 21:37:15 +01:00
fix(print): allow dead code on non-unix platforms
Build Linux Packages / Build Linux (pull_request) Failing after 12m40s
9a227bcc8b
gronod added 1 commit 2026-08-23 21:38:05 +01:00
fix(commands): fix test assertions for targen, colprof and profcheck
Build Linux Packages / Build Linux (pull_request) Failing after 12m12s
860d2971f9
gronod added 1 commit 2026-08-23 21:38:54 +01:00
fix(print): fix DEVMODEW anonymous union access for dmDefaultSource and dmOrientation
Build Linux Packages / Build Linux (pull_request) Failing after 11m42s
19449e3493
gronod added 1 commit 2026-08-23 21:55:44 +01:00
fix(ci): raw YAML update for build-windows workflow
Build Windows Packages / Build Windows (pull_request) Failing after 1m0s
Build Linux Packages / Build Linux (pull_request) Has been cancelled
a61d4c7f5b
gronod added 1 commit 2026-08-23 21:55:55 +01:00
fix(print): raw rust code for mod.rs
Build Windows Packages / Build Windows (pull_request) Failing after 1m21s
Build Linux Packages / Build Linux (pull_request) Has been cancelled
5bdef6f3d2
gronod added 1 commit 2026-08-23 21:56:20 +01:00
fix(print): raw rust code for unix.rs
Build Linux Packages / Build Linux (pull_request) Has been cancelled
Build Windows Packages / Build Windows (pull_request) Has been cancelled
940d0f7083
gronod added 1 commit 2026-08-23 21:56:37 +01:00
fix(commands): raw rust code for commands.rs
Build Linux Packages / Build Linux (pull_request) Has been cancelled
Build Windows Packages / Build Windows (pull_request) Failing after 52s
a2eba578e3
gronod added 1 commit 2026-08-23 21:56:52 +01:00
fix(print): raw rust code for windows.rs
Build Linux Packages / Build Linux (pull_request) Has been cancelled
Build Windows Packages / Build Windows (pull_request) Failing after 39s
b823a18ac5
gronod added 1 commit 2026-08-23 21:57:26 +01:00
fix(ci): use shell: powershell for Windows host runner
Build Linux Packages / Build Linux (pull_request) Has been cancelled
Build Windows Packages / Build Windows (pull_request) Has been cancelled
159731a63b
gronod merged commit 41dd98bb55 into development 2026-08-23 22:01:57 +01:00
Sign in to join this conversation.