Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

M10.5: Preserve current main printing workers during spooler extraction

skylar taylor-barrick6614b370b174
diff --cc crates/print/README.md
index b73c6ff5e,c4d44fc4b..df7db109f
--- a/crates/print/README.md
+++ b/crates/print/README.md
@@@ -32,18 -32,17 +32,20 @@@ Each source page becomes a Form XObjec
annotations); sheets place them with a clip. The result is a fresh, unencrypted,
garbage-collected file (callers check the print permission).
-`spool` talks to CUPS on macOS and Linux: printers come from `lpstat -p -d` (the queues) and
-`lpstat -e` (driverless destinations no queue exists for; CUPS builds a temporary one when the
-job arrives), jobs go to `lp` with copies, collation, duplex and monochrome options. The job is
-piped to `lp` on stdin and never written to a temp file, where another local user could read or
-swap it. On Windows the printers come from `Win32_Printer` and jobs are rendered by the in-box
-`Windows.Data.Pdf` and spooled by `System.Drawing.Printing` with the driver's own settings (both
-through `powershell`, so no Win32 API is called here); that job file exists for the seconds the
-spooler reads it, under a fresh unpredictable name. Each sheet prints at 100% on the driver's
-paper closest to its size, turned landscape when it is wide, and is rasterised at the printer's
-resolution (up to 600 dpi), not sent as vectors. Other platforms report that printing to a
-printer isn't available yet; the print-ready PDF can always be saved.
+`spool` delegates discovery, driver options, preferences and submission to
+[`craft-print`](https://github.com/storytold/craft-libs/tree/main/crates/print).
+PdfCraft retains page selection, imposition, annotations and print-permission checks.
+CUPS jobs stream through stdin with `fit-to-page=false`. Windows renders sheets through
+`Windows.Data.Pdf` and spools them at their physical PDF size with per-page paper and
+orientation, zero added margins and hardware-edge clipping. Long-edge and short-edge duplex
+use the corresponding Windows binding edges. Random, exclusively created Windows job files
+are removed on success and failure. Other targets offer the print-ready PDF instead.
+
+The shared dependency requires Rust 1.95. Transport and native Windows regression tests
+live in craft-libs; local tests retain composition, facade, engine, automation and UI coverage.
- Physical printer output still needs hardware validation.
++The desktop UI discovers printers and submits jobs on workers, so neither operation blocks
++the dialog; the Windows backend starts without a console window. Physical printer output
++still needs hardware validation.
Not yet: the web spooler, print as image, poster labels, PostScript output, colour conversion for
grayscale.
diff --cc parity/acrobat-features.toml
index 3c35d730b,e15ed9e36..62590cbef
--- a/parity/acrobat-features.toml
+++ b/parity/acrobat-features.toml
@@@ -7866,8 -7866,8 +7866,8 @@@ milestone = "M10
status = "shipped"
commands = ["print.dialog"]
tools = ["printers", "printer_options", "doc_print"]
- evidence = ["crates/print/src/tests.rs::spooler_arguments_and_printer_list", "crates/print/src/tests.rs::driverless_printers_join_the_list_without_a_queue", "crates/print/src/tests.rs::windows_printers_carry_one_default_and_keep_their_names", "crates/print/src/tests.rs::printer_options_come_from_the_ppd", "crates/print/src/tests.rs::printer_option_defaults_and_job_arguments", "crates/ui-egui/tests/print.rs::print_dialog_shows_the_printer_driver_options"]
- notes = "CUPS queues via lpstat -p -d and driverless destinations without a queue via lpstat -e; on Windows the queues and the default come from Win32_Printer (PowerShell CIM) and jobs are rendered with Windows.Data.Pdf and spooled with the driver's own settings; Save as PDF on every platform. Properties…: on CUPS the driver's own PPD job options (tray, paper type, finishing …, not installable options or what the dialog sets) for this job, sent as lp -o; on Windows the driver's Printing Preferences window (printui), saved as that printer's per-user defaults rather than per job"
-evidence = ["crates/print/src/tests.rs::spooler_arguments_and_printer_list", "crates/print/src/tests.rs::driverless_printers_join_the_list_without_a_queue", "crates/print/src/tests.rs::windows_printers_carry_one_default_and_keep_their_names", "crates/print/src/tests.rs::windows_lists_the_printers_the_system_knows", "crates/print/src/tests.rs::the_print_script_renders_the_job_and_reaches_the_spooler", "crates/print/src/tests.rs::printer_options_come_from_the_ppd", "crates/print/src/tests.rs::printer_option_defaults_and_job_arguments", "crates/ui-egui/tests/print.rs::print_dialog_shows_the_printer_driver_options"]
-notes = "CUPS queues via lpstat -p -d and driverless destinations without a queue via lpstat -e; on Windows the queues and the default come from Win32_Printer (PowerShell CIM) and jobs are rendered with Windows.Data.Pdf and spooled with the driver's own settings, each sheet at 100% on the driver's paper closest to its size (landscape for a wide sheet; shrunk only when no paper is large enough), rasterised at the printer's resolution up to 600 dpi and about 64 megapixels a sheet, not sent as vectors; the printer list and the job run in the background, without a console window; Save as PDF on every platform. Properties…: on CUPS the driver's own PPD job options (tray, paper type, finishing …, not installable options or what the dialog sets) for this job, sent as lp -o; on Windows the driver's Printing Preferences window (printui), saved as that printer's per-user defaults rather than per job"
++evidence = ["crates/print/src/tests.rs::spooler_arguments_and_printer_list", "crates/print/src/tests.rs::driverless_printers_join_the_list_without_a_queue", "crates/print/src/tests.rs::windows_printers_carry_one_default_and_keep_their_names", "crates/print/src/tests.rs::printer_options_come_from_the_ppd", "crates/print/src/tests.rs::printer_option_defaults_and_job_arguments", "crates/ui-egui/tests/print.rs::print_dialog_shows_the_printer_driver_options", "crates/ui-egui/tests/print.rs::printers_listed_in_the_background_preselect_the_default_unless_one_was_picked"]
++notes = "CUPS queues via lpstat -p -d and driverless destinations without a queue via lpstat -e; on Windows the queues and the default come from Win32_Printer (PowerShell CIM) and jobs are rendered with Windows.Data.Pdf and spooled through shared craft-print at each sheet's physical size and orientation, with bounded raster resolution up to 600 dpi (not vector passthrough); the printer list and submission run on workers without a console window. Native Windows regression execution is pending; Save as PDF on every platform. Properties…: on CUPS the driver's own PPD job options (tray, paper type, finishing …, not installable options or what the dialog sets) for this job, sent as lp -o; on Windows the driver's Printing Preferences window (printui), saved as that printer's per-user defaults rather than per job"
[[feature]]
id = "print.copies-collate"