fix(print): preserve cached DEVMODE printer preferences on Windows (#36) #37

Merged
gronod merged 1 commits from bugfix/issue-36-windows-devmode-preferences into development 2026-08-24 09:13:00 +01:00
Owner

Summary

Resolves #36 by ensuring that printer driver preferences (DEVMODE) configured in the native modal dialog (show_printer_properties) are retained and passed to the printer Device Context (CreateDCW) during Windows printing.

Changes

  1. DEVMODE Preservation: Fixed print_target in src-tauri/src/print/windows.rs to retain cached DEVMODE buffers (including private OEM driver payload dmDriverExtra such as Epson Print Preview, media types, and quality settings) instead of resetting them to defaults via DocumentPropertiesW(..., DM_OUT_BUFFER).
  2. Modular Option Overlay: Added apply_print_options_to_devmode to apply GDI ICM bypass (DMICMMETHOD_NONE) and UI option overlays (tray, orientation) onto DEVMODE structures without clobbering OEM vendor data.
  3. Automated Unit & Integration Tests: Added test_windows_devmode_preservation_and_overrides in src-tauri/src/print/tests.rs to verify that private OEM driver extensions are retained through store retrieval and print options application.
  4. Version Bump: Increment point version to 0.1.3 in package.json, package-lock.json, src-tauri/Cargo.toml, and src-tauri/tauri.conf.json.

Verification

  • 28/28 unit and integration tests passed cleanly (cargo test).
### Summary Resolves #36 by ensuring that printer driver preferences (DEVMODE) configured in the native modal dialog (`show_printer_properties`) are retained and passed to the printer Device Context (`CreateDCW`) during Windows printing. ### Changes 1. **DEVMODE Preservation**: Fixed `print_target` in `src-tauri/src/print/windows.rs` to retain cached DEVMODE buffers (including private OEM driver payload `dmDriverExtra` such as Epson Print Preview, media types, and quality settings) instead of resetting them to defaults via `DocumentPropertiesW(..., DM_OUT_BUFFER)`. 2. **Modular Option Overlay**: Added `apply_print_options_to_devmode` to apply GDI ICM bypass (`DMICMMETHOD_NONE`) and UI option overlays (tray, orientation) onto DEVMODE structures without clobbering OEM vendor data. 3. **Automated Unit & Integration Tests**: Added `test_windows_devmode_preservation_and_overrides` in `src-tauri/src/print/tests.rs` to verify that private OEM driver extensions are retained through store retrieval and print options application. 4. **Version Bump**: Increment point version to `0.1.3` in `package.json`, `package-lock.json`, `src-tauri/Cargo.toml`, and `src-tauri/tauri.conf.json`. ### Verification - 28/28 unit and integration tests passed cleanly (`cargo test`).
gronod added 1 commit 2026-08-24 09:12:55 +01:00
fix(print): preserve cached DEVMODE printer preferences on Windows (#36)
Build Linux Packages / Build Linux (pull_request) Has been cancelled
Build Windows Packages / Build Windows (pull_request) Has been cancelled
e22845fd73
gronod merged commit 4824bb0aac into development 2026-08-24 09:13:00 +01:00
gronod deleted branch bugfix/issue-36-windows-devmode-preferences 2026-08-24 09:13:01 +01:00
Sign in to join this conversation.