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.
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).
Media & Page Setup Controls (get_printer_capabilities):
Paper Source / Tray Selector: Dynamically queries supported paper trays (DeviceCapabilitiesWDC_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).
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).
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).
### 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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
Native Printer Driver Properties Dialog (
show_printer_properties):DocumentPropertiesWmodally withDM_IN_PROMPT | DM_IN_BUFFER | DM_OUT_BUFFERto present the native OEM printer driver setup dialog, retaining customizedDEVMODEWsettings in backend session memory (PrinterDevModeStore).Media & Page Setup Controls (
get_printer_capabilities):DeviceCapabilitiesWDC_BINS/DC_BINNAMESon Windows; CUPSInputSlotvialpoptionson Unix).dmOrientation/-o orientation-requested=3/4).Behind-the-Scenes Automatic Page-Fit Scaler:
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.SetICMMode(hdc, ICM_OFF)& raw passthrough).Automated & Unit Tests:
PrinterCapabilities,PrintOptions, andPrinterDevModeStore.lpoptionsparsing and argument building with orientation/media options.Related Issue
Closes #34