Implement a native printing engine in the Tauri Rust backend to print generated target TIFFs directly to the user's printer while strictly bypassing all OS and printer driver colour management. This must replicate the behavior of the Adobe Color Print Utility (ACPU), ensuring the printed targets are completely raw and unadjusted for accurate ICC profiling.
Sub-Tasks (Milestone 6: Native Raw OS Printing Engine)
#26 - Sub-Task 1: Windows Native Raw Print Spooler (GDI/ICM Bypass) (PR #29)
Currently, web-based applications rely on window.print(), which strictly enforces browser and OS-level color management (sRGB/Display P3 transforms) and offers no API to disable it. To achieve raw color output:
Windows: The Image Color Management (ICM) layer and printer driver optimizations must be explicitly bypassed.
macOS: Apple's ColorSync applies transformations automatically unless bypassed via specialized PrintCore flags or raw CUPS queues.
Linux: CUPS applies its own PPD-based color profiles.
Requirements
Native Print Spooling: A Tauri Rust command that accepts a TIFF file path and a target printer name.
Absolute Color Management Bypass:
Ensure RGB/CMYK values in the TIFF are sent unaltered to the printer nozzles.
Cross-Platform Support: Must work seamlessly on Windows, macOS, and Linux.
No License Taint: Any integrated libraries must be permissively licensed (e.g., MIT, Apache-2.0).
Potential Solutions & Open Source Libraries
Because this cannot be done in JavaScript/HTML, it must be implemented as a Rust backend capability.
1. Linux & macOS (CUPS-based approaches)
macOS and Linux both use CUPS (Common Unix Printing System) under the hood.
Solution: Submit the print job directly to the CUPS daemon as a raw stream, using the -o raw option and ensuring no ColorSync/ICC PPD filters are applied in the pipeline.
Libraries:
cups-rs (MIT): Idiomatic, safe bindings for the native CUPS library.
printers (MIT): A cross-platform print job manager that interfaces with CUPS on Unix systems.
2. Windows (GDI / WinSpool approaches)
Windows requires navigating the GDI (Graphics Device Interface) or XPS print paths.
Solution: Open a print handle, configure the printer's DEVMODE structure to disable color adjustment, and explicitly call SetICMMode(hDC, ICM_OFF) to prevent the Windows GDI from altering the color payload. Alternatively, send a raw PostScript/PCL blob directly to the spooler if supported.
Libraries:
winprint (MIT/Apache-2.0): Specialized crate for Windows printing APIs.
Standard windows-rs (MIT) bindings to directly access OpenPrinter, StartDocPrinter, and SetICMMode.
3. Image Preparation & Rasterization
Printers often require rasterized payload formats (like PDF or specific spool formats).
Libraries: Use the image crate (MIT) to process the TIFF, combined with Ghostscript (if invoked as an external process) or PDF generation crates like printpdf (MIT) to package the unmanaged image into a printable document without assigning an ICC profile.
### Objective
Implement a native printing engine in the Tauri Rust backend to print generated target TIFFs directly to the user's printer while **strictly bypassing all OS and printer driver colour management**. This must replicate the behavior of the Adobe Color Print Utility (ACPU), ensuring the printed targets are completely raw and unadjusted for accurate ICC profiling.
### Sub-Tasks (Milestone 6: Native Raw OS Printing Engine)
- [x] #26 - Sub-Task 1: Windows Native Raw Print Spooler (GDI/ICM Bypass) (PR #29)
- [x] #27 - Sub-Task 2: macOS/Linux Native Raw Print Spooler (CUPS) (PR #30)
- [x] #28 - Sub-Task 3: Raw Printing UI Integration (Frontend & IPC) (PR #31)
### Background & Challenge
Currently, web-based applications rely on `window.print()`, which strictly enforces browser and OS-level color management (sRGB/Display P3 transforms) and offers no API to disable it. To achieve raw color output:
- **Windows:** The Image Color Management (ICM) layer and printer driver optimizations must be explicitly bypassed.
- **macOS:** Apple's ColorSync applies transformations automatically unless bypassed via specialized PrintCore flags or raw CUPS queues.
- **Linux:** CUPS applies its own PPD-based color profiles.
### Requirements
- **Native Print Spooling:** A Tauri Rust command that accepts a TIFF file path and a target printer name.
- **Absolute Color Management Bypass:**
- Ensure RGB/CMYK values in the TIFF are sent unaltered to the printer nozzles.
- **Cross-Platform Support:** Must work seamlessly on Windows, macOS, and Linux.
- **No License Taint:** Any integrated libraries must be permissively licensed (e.g., MIT, Apache-2.0).
### Potential Solutions & Open Source Libraries
Because this cannot be done in JavaScript/HTML, it must be implemented as a Rust backend capability.
#### 1. Linux & macOS (CUPS-based approaches)
macOS and Linux both use CUPS (Common Unix Printing System) under the hood.
- **Solution:** Submit the print job directly to the CUPS daemon as a raw stream, using the `-o raw` option and ensuring no ColorSync/ICC PPD filters are applied in the pipeline.
- **Libraries:**
- [`cups-rs`](https://crates.io/crates/cups-rs) (MIT): Idiomatic, safe bindings for the native CUPS library.
- [`printers`](https://crates.io/crates/printers) (MIT): A cross-platform print job manager that interfaces with CUPS on Unix systems.
#### 2. Windows (GDI / WinSpool approaches)
Windows requires navigating the GDI (Graphics Device Interface) or XPS print paths.
- **Solution:** Open a print handle, configure the printer's `DEVMODE` structure to disable color adjustment, and explicitly call `SetICMMode(hDC, ICM_OFF)` to prevent the Windows GDI from altering the color payload. Alternatively, send a raw PostScript/PCL blob directly to the spooler if supported.
- **Libraries:**
- [`winprint`](https://crates.io/crates/winprint) (MIT/Apache-2.0): Specialized crate for Windows printing APIs.
- Standard `windows-rs` (MIT) bindings to directly access `OpenPrinter`, `StartDocPrinter`, and `SetICMMode`.
#### 3. Image Preparation & Rasterization
Printers often require rasterized payload formats (like PDF or specific spool formats).
- **Libraries:** Use the [`image`](https://crates.io/crates/image) crate (MIT) to process the TIFF, combined with Ghostscript (if invoked as an external process) or PDF generation crates like [`printpdf`](https://crates.io/crates/printpdf) (MIT) to package the unmanaged image into a printable document without assigning an ICC profile.
gronod
added this to the Milestone 6: Native Raw OS Printing Engine milestone 2026-08-23 10:24:35 +01:00
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.
Objective
Implement a native printing engine in the Tauri Rust backend to print generated target TIFFs directly to the user's printer while strictly bypassing all OS and printer driver colour management. This must replicate the behavior of the Adobe Color Print Utility (ACPU), ensuring the printed targets are completely raw and unadjusted for accurate ICC profiling.
Sub-Tasks (Milestone 6: Native Raw OS Printing Engine)
Background & Challenge
Currently, web-based applications rely on
window.print(), which strictly enforces browser and OS-level color management (sRGB/Display P3 transforms) and offers no API to disable it. To achieve raw color output:Requirements
Potential Solutions & Open Source Libraries
Because this cannot be done in JavaScript/HTML, it must be implemented as a Rust backend capability.
1. Linux & macOS (CUPS-based approaches)
macOS and Linux both use CUPS (Common Unix Printing System) under the hood.
-o rawoption and ensuring no ColorSync/ICC PPD filters are applied in the pipeline.cups-rs(MIT): Idiomatic, safe bindings for the native CUPS library.printers(MIT): A cross-platform print job manager that interfaces with CUPS on Unix systems.2. Windows (GDI / WinSpool approaches)
Windows requires navigating the GDI (Graphics Device Interface) or XPS print paths.
DEVMODEstructure to disable color adjustment, and explicitly callSetICMMode(hDC, ICM_OFF)to prevent the Windows GDI from altering the color payload. Alternatively, send a raw PostScript/PCL blob directly to the spooler if supported.winprint(MIT/Apache-2.0): Specialized crate for Windows printing APIs.windows-rs(MIT) bindings to directly accessOpenPrinter,StartDocPrinter, andSetICMMode.3. Image Preparation & Rasterization
Printers often require rasterized payload formats (like PDF or specific spool formats).
imagecrate (MIT) to process the TIFF, combined with Ghostscript (if invoked as an external process) or PDF generation crates likeprintpdf(MIT) to package the unmanaged image into a printable document without assigning an ICC profile.