Print: make a long printer list easier to browse and search (#4399)

**Update on 2026-11-03 (`db57e7de`).** Merged main `ecdd1e65` and preserved both sets of parity evidence. The picker now uses the public `ComboBox::show_ui` response to track the open menu and clear its search when it closes. All 30 print UI tests passed locally on macOS arm64, including the three printer-picker regressions. Formatting and `cargo xtask parity` passed. [CI](https://github.com/storytold/pdfcraft/actions/runs/41673448570) and [SonarCloud](https://github.com/storytold/pdfcraft/actions/runs/41673448592) track this commit.

## What this changes

Fixes #4399.

The printer picker opens a wider, taller menu with a name filter. Long device names wrap, while Search and Save as PDF stay visible as the device list scrolls. Search ignores case, trims surrounding spaces and keeps the current destination until a row is chosen. Reopening clears the filter and brings the selected device into view.

The large-fleet test now checks that the selected row is between Search and Save as PDF after reopening, without manually scrolling at that point. This catches a broken automatic reveal instead of hiding it with a test-side scroll.

## How you verified it

- At `d14aed41`, the [hosted gate](https://github.com/storytold/pdfcraft/actions/runs/40305529036/job/121513571419) passes: 5,194 tests, 21 skipped. All three `printer_picker` tests explicitly pass, including the new reopening visibility assertion. Formatting, strict Clippy, layers, assets, parity and wasm checks pass in that gate.
- CodeRabbit's refreshed documentation check passes at 100%; both remaining test helpers are documented.
- The three original UI regressions failed against the original production module. They cover a 120-device fleet, Unicode/case matching, selection, reopening, no matches, long names and a 1024×768 window. A separate earlier before/after check caught an initially clipped Save as PDF row by physically clicking it.
- Earlier macOS validation inspected headless captures and exercised the real Print dialog through its control channel. Those are earlier-run results, not a new native macOS run on this head.
- The current local Windows Cargo 1.95 run cannot resolve the pinned craft-menu manifest and does not reach the UI tests. Runtime validation of this latest test update is the hosted gate above; no local test pass is claimed.

## Safety, provenance and reach

- [x] No new panicking shortcuts, unsafe code or input-derived indexing.
- [x] No new assets, fonts or dependencies.
- [x] Existing printer discovery, properties and print submission paths are used.
- [x] Automation remains available through `printers`, `printer_options` and `doc_print`; UI controls remain opt-in.
- [x] Printer-selection parity evidence and M10 progress notes are updated.

## Limits of verification

Physical printing was not tested. Keyboard injection into the earlier background native macOS window did not enter text; filter typing and selection were verified through egui_kittest.

AI assistance: implementation, tests and validation used Codex.
This commit is contained in:
Perchenko Anton authored and GitHub committed 2026-11-18 16:31:06 +07:00
1 parent cc0edc29d1
commit 0c39992c99
5 files changed
+209 -29

No files matched your search

+1
View File
@@ -353,6 +353,7 @@ Ranked; detail and the full milestone table in [docs/roadmap.md](docs/roadmap.md
- **2026-10-26 (M3, view.text-select):** Text selection runs across pages: dragging onto another page (also a quick flick off the page, and the edge and wheel scrolling of #721/#1670) or ⇧-clicking there selects the rest of the first page, the pages between and the last page up to the pointer. Copy has each page's part on a line of its own, reading pages not yet read off the UI thread; highlight, underline, strikethrough and Redact put one mark on each page in one undo step (a tool that finishes first marks once the pages are read; Redact refuses a selection over a page whose text could not be read); Add comment and Replace text stay one-page. A drag from one page's text that is already over the next when it starts no longer begins a Redact or area-highlight box there. Estimates unchanged.
- **2026-10-25 (M5, comment replies):** One reply can be deleted from the Comments panel without its thread. On the selected card each reply has its own "…" menu (Edit, Copy text, Delete); Delete takes that reply with its pop-up and the replies to it, as `comment_delete` already did headlessly, and the comment and its other replies stay. The card stays selected, and the panel's editor stays open, on what they were on though the delete moved it in `/Annots`. Undo and Redo close the editor, since either can move what it was open on. A locked reply can't be deleted. Estimates unchanged.
- **2026-10-25 (M7, #2750):** Single-style Keep source fonts edits retain source glyphs and batch only missing glyphs in fallback fonts. Per-rewrite character eligibility and widths are cached; source and fallback edge spaces stay extractable. Estimates unchanged.
- **2026-10-25 (M10, #4399):** The printer picker has a wider searchable list, wrapped device names, stable selection while filtering, and Search and Save as PDF kept visible. Synthetic fleet UI regressions cover long lists and a smaller window. Estimates unchanged.
- **2026-10-25 (web, same-document host mode):** A page that loads the PdfCraft web module into its own document (no iframe) can opt into the host bridge with `data-host="page"` on the app's canvas — the exact value `page`; any other value keeps the normal app with downloads, unless a same-origin framed `?host=parent` selects the parent bridge (unframed or cross-origin, `?host=parent` also keeps the normal app). It is the `?host=parent` bridge with the transport swapped: the same five messages travel as non-bubbling `CustomEvent`s on the canvas (`detail` holds the parent messages' fields without `type`; the host answers with a `pdfcraft:open` event), so saves reach the host instead of downloading and dirty and start-up-failure reporting are unchanged. Unit tests cover the opt-in rule; no parity or estimate changes.
- **2026-10-25 (M10):** Vector printing keeps field and comment artwork whose rectangle coordinates are indirect, requiring exactly four finite resolved values.
- **2026-10-26 (M10):** Vector printing follows up to 64 indirect references for annotation rectangles, coordinates and appearance-state names, rejecting cycles and longer chains without changing source objects.
+86 -26
View File
@@ -103,6 +103,91 @@ fn combo<T: PartialEq + Copy>(ui: &mut egui::Ui, id: &str, name: &str, value: &m
.accessible_name(name);
}
/// A wide, searchable fleet list; filtering never changes the selected destination.
fn printer_picker(ui: &mut egui::Ui, d: &mut PrintDraft) -> egui::Response {
let filter_id = ui.make_persistent_id("printer-filter");
// Keep the search only while the combo box renders its popup contents.
let previous_filter = ui.data(|data| data.get_temp::<String>(filter_id));
let opening = previous_filter.is_none();
let mut filter = previous_filter.unwrap_or_default();
let shown = match d.printer.as_deref() {
Some(p) => printer_label(p),
None if still_looking(d) => tl!("Looking for printers…").to_string(),
None => tl!("Save as PDF").to_string(),
};
let screen = ui.ctx().content_rect();
let width = 430.0_f32.min((screen.width() - 32.0).max(0.0));
let height = 420.0_f32.min(screen.height() * 0.6);
let response = craft_ui::ComboBox::from_id_salt("printer")
.selected_text(&shown)
.width(260.0)
.truncate()
.height(height)
.close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside)
.show_ui(ui, |ui| {
ui.set_width(width);
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Wrap);
let search_label = ui.label(tl!("Search printers"));
let search = ui.add(widgets::line(&mut filter).desired_width(f32::INFINITY).char_limit(256)).labelled_by(search_label.id);
if opening {
search.request_focus();
}
let query = pdfcraft_render::text::fold_case(filter.trim());
if d.printers_loading {
ui.add_enabled(false, egui::Label::new(tl!("Looking for printers…")));
}
// Keep the search and Save as PDF visible while the devices scroll.
// The popup's actual clip can be shorter than the requested height.
let footer_height = ui.spacing().interact_size.y + 4.0 * ui.spacing().item_spacing.y;
let list_height = (ui.clip_rect().bottom() - ui.cursor().top() - footer_height).clamp(0.0, height);
let mut list = egui::ScrollArea::vertical().id_salt("printer-results").max_height(list_height);
if search.changed() {
list = list.vertical_scroll_offset(0.0);
}
list.show(ui, |ui| {
let mut matched = false;
for p in &d.printers {
let name = printer_label(&p.name);
if !query.is_empty() && !pdfcraft_render::text::fold_case(&name).contains(&query) {
continue;
}
matched = true;
let label = if p.default && p.name != crate::web_print::BROWSER_PRINTER {
crate::i18n::fmt(tl!("{name} (default)"), &[("name", &name)])
} else {
name
};
let selected = d.printer.as_deref() == Some(p.name.as_str());
let choice = ui.selectable_value(&mut d.printer, Some(p.name.clone()), label);
if opening && selected {
choice.scroll_to_me(Some(egui::Align::Center));
}
if choice.clicked() {
d.printer_picked = true;
ui.close();
}
}
if !matched && !query.is_empty() && !d.printers_loading {
ui.label(tl!("No printers match."));
}
});
ui.separator();
// An explicit choice also protects PDF from a late default-printer refresh.
if ui.selectable_value(&mut d.printer, None, tl!("Save as PDF")).clicked() {
d.printer_picked = true;
ui.close();
}
});
ui.data_mut(|data| {
if response.inner.is_some() {
data.insert_temp(filter_id, filter);
} else {
data.remove::<String>(filter_id);
}
});
response.response.on_hover_text(shown)
}
/// Draw the dialog. `thumb` gives a page's thumbnail texture when there is one. Returns
/// (print, cancel).
pub(crate) fn body(
@@ -146,32 +231,7 @@ pub(crate) fn body(
// The browser's print dialog sets copies, two-sided printing and colour itself.
let browser = d.printer.as_deref() == Some(crate::web_print::BROWSER_PRINTER);
ui.horizontal(|ui| {
let shown = match d.printer.as_deref() {
Some(p) => printer_label(p),
None if still_looking(d) => tl!("Looking for printers…").to_string(),
None => tl!("Save as PDF").to_string(),
};
craft_ui::ComboBox::from_id_salt("printer").selected_text(shown).width(260.0).show_ui(ui, |ui| {
if d.printers_loading {
ui.add_enabled(false, egui::Label::new(tl!("Looking for printers…")));
}
for p in &d.printers {
let name = printer_label(&p.name);
let label = if p.default && p.name != crate::web_print::BROWSER_PRINTER {
crate::i18n::fmt(tl!("{name} (default)"), &[("name", &name)])
} else {
name
};
ui.selectable_value(&mut d.printer, Some(p.name.clone()), label);
}
// Chosen even when it was already the selection, so the list arriving
// later doesn't replace it with the default printer.
if ui.selectable_value(&mut d.printer, None, tl!("Save as PDF")).clicked() {
d.printer_picked = true;
}
})
.response
.labelled_by(printer_caption.id);
printer_picker(ui, d).labelled_by(printer_caption.id);
let tip = if spool::HAS_PRINTER_PREFERENCES {
tl!("Opens the printer driver's preferences. They are saved for every print from this computer; the copies, two-sided, grayscale and paper chosen here still apply.")
} else {
+118
View File
@@ -5,10 +5,12 @@ use egui_kittest::Harness;
use egui_kittest::kittest::{NodeT, Queryable};
use pdfcraft_ui_egui::{Dialog, PdfCraftApp};
/// Open a bundled synthetic form with the default print settings.
fn harness() -> Harness<'static, PdfCraftApp> {
harness_with_settings(None)
}
/// Restore optional settings before opening the form and settling the shell frames.
fn harness_with_settings(settings: Option<String>) -> Harness<'static, PdfCraftApp> {
let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(move |_cc| {
let mut app = PdfCraftApp::new();
@@ -23,6 +25,122 @@ fn harness_with_settings(settings: Option<String>) -> Harness<'static, PdfCraftA
h
}
/// A large synthetic fleet, independent of the host's installed printers.
fn harness_with_printers() -> (Harness<'static, PdfCraftApp>, String) {
use pdfcraft_engine::print::spool::Printer;
let mut h = harness();
let last = "München Satellite 119 - Engineering floor 4 (network queue) - colour duplex device, Building North".to_string();
let mut printers: Vec<_> = (0..119)
.map(|i| Printer {
name: format!("Office {i:03} - Engineering floor 4 (network queue)"),
description: String::new(),
default: i == 0,
two_sided: None,
})
.collect();
printers.push(Printer { name: last.clone(), description: String::new(), default: false, two_sided: None });
h.state_mut().printer_source = Some(std::sync::Arc::new(move || printers.clone()));
assert!(h.state_mut().execute("print.dialog"));
let deadline = std::time::Instant::now() + std::time::Duration::from_secs(10);
while h.state().print_draft.printers_loading && std::time::Instant::now() < deadline {
h.run_steps(1);
std::thread::sleep(std::time::Duration::from_millis(5));
}
assert!(!h.state().print_draft.printers_loading);
h.run_steps(3);
(h, last)
}
/// Searching folds names without selecting a device, and reopening restores the fleet.
#[test]
fn printer_picker_filters_a_large_fleet_without_changing_the_selection() {
let (mut h, last) = harness_with_printers();
let initial = h.state().print_draft.printer.clone();
h.get_by_value(initial.as_deref().unwrap()).click();
h.run_steps(3);
let search = h.get_by_role_and_label(Role::TextInput, "Search printers");
assert!(search.rect().width() > 350.0, "room for long device names");
search.type_text(" MÜNCHEN satellite ");
h.run_steps(3);
assert_eq!(h.state().print_draft.printer, initial, "typing is not a printer choice");
assert!(!h.state().print_draft.printer_picked);
assert!(h.query_by_label("Office 001 - Engineering floor 4 (network queue)").is_none());
h.get_by_label(&last).click();
h.run_steps(3);
assert_eq!(h.state().print_draft.printer.as_deref(), Some(last.as_str()));
assert!(h.state().print_draft.printer_picked);
assert!(h.query_by_role_and_label(Role::TextInput, "Search printers").is_none(), "choosing closes the popup");
// A fresh opening shows the whole fleet again, including a choice outside the old filter.
h.get_by_value(&last).click();
h.run_steps(3);
h.get_by_label("Office 001 - Engineering floor 4 (network queue)").scroll_to_me();
h.run_steps(4);
h.get_by_label("Office 001 - Engineering floor 4 (network queue)").click();
h.run_steps(2);
assert_eq!(h.state().print_draft.printer.as_deref(), Some("Office 001 - Engineering floor 4 (network queue)"));
}
/// PDF remains an explicit destination even when no physical device matches the search.
#[test]
fn printer_picker_keeps_save_as_pdf_available_when_the_filter_matches_nothing() {
let (mut h, _) = harness_with_printers();
let initial = h.state().print_draft.printer.clone();
h.get_by_value(initial.as_deref().unwrap()).click();
h.run_steps(3);
// Clicking in the filter must not close the popup, unlike choosing a device.
h.get_by_role_and_label(Role::TextInput, "Search printers").click();
h.run_steps(2);
h.get_by_role_and_label(Role::TextInput, "Search printers").type_text("no-such-printer");
h.run_steps(3);
h.get_by_label("No printers match.");
assert_eq!(h.state().print_draft.printer, initial);
h.get_by_label("Save as PDF").click();
h.run_steps(3);
assert_eq!(h.state().print_draft.printer, None);
assert!(h.state().print_draft.printer_picked);
assert!(h.query_by_role_and_label(Role::TextInput, "Search printers").is_none());
assert_eq!(h.state().dialog, Some(Dialog::Print), "selecting PDF must not submit the job");
}
/// Scrolling and wrapped names must leave the pinned footer physically clickable.
#[test]
fn printer_picker_scrolls_long_names_without_losing_the_search_or_pdf_choice() {
let (mut h, last) = harness_with_printers();
let size = egui::vec2(1024.0, 768.0);
h.set_size(size);
h.run_steps(4);
let initial = h.state().print_draft.printer.clone();
h.get_by_value(initial.as_deref().unwrap()).click();
h.run_steps(3);
let search = h.get_by_role_and_label(Role::TextInput, "Search printers").rect();
let pdf = h.get_by_label("Save as PDF").rect();
assert!(pdf.top() - search.bottom() > 200.0, "show more than a few device rows");
h.get_by_label(&last).scroll_to_me();
h.run_steps(5);
let row = h.get_by_label(&last).rect();
assert!(row.left() >= 0.0 && row.right() <= size.x, "long names wrap within the viewport: {row:?}");
let search = h.get_by_role_and_label(Role::TextInput, "Search printers").rect();
let pdf = h.get_by_label("Save as PDF").rect();
assert!(search.top() >= 0.0 && pdf.bottom() <= size.y, "search and PDF stay on screen");
h.get_by_label(&last).click();
h.run_steps(3);
assert_eq!(h.state().print_draft.printer.as_deref(), Some(last.as_str()));
h.get_by_value(&last).click();
h.run_steps(3);
// Reopening must scroll to the selection itself; manual scrolling would mask a regression.
let search = h.get_by_role_and_label(Role::TextInput, "Search printers").rect();
let row = h.get_by_label(&last).rect();
let pdf = h.get_by_label("Save as PDF").rect();
assert!(
row.top() >= search.bottom() && row.bottom() <= pdf.top(),
"the selected printer is visible on reopening: {row:?}, search {search:?}, PDF {pdf:?}"
);
h.get_by_label("Save as PDF").click();
h.run_steps(3);
assert_eq!(h.state().print_draft.printer, None, "the PDF row must be clickable with the full fleet shown");
}
/// The page-range field is labelled by the Pages radio button rather than floating unnamed.
#[test]
fn the_page_range_field_is_named_for_screen_readers() {
+2 -1
View File
@@ -291,7 +291,7 @@ total matches the parity estimate.
| M11 | Optimize, preflight, PDF/A/X/UA, print production | 200–350 | 18% | 80–140 | Done: new `optimize` crate: Reduce File Size and the PDF Optimizer (images measured where drawn, bicubic downsampling, JPEG/ZIP recompression only when smaller, discard objects and user data, Flate clean-up, resource merging, object streams). Target-version compatibility is partial: newer content is not detected or converted. Content stream boundaries preserve comments, split operands and graphics state when image fragments merge. Image downsampling includes page-local `/UserUnit` scaling when measuring physical resolution. Done since: reject invalid image and soft-mask dimensions with checked sizing (#2178). Missing: fonts and transparency panels, space audit, preflight, PDF/A/X/UA |
| M8 | Security + redaction | 100–180 | 68% | 15–30 | Done: opening protected documents, permissions, Protect Using Password, Remove security; redaction (mark text/areas/pages, Search & Redact with patterns, apply removing glyphs, image pixels, vectors, XObject content, annotations and fields, verification, full rewrite on save); Remove hidden information and Sanitize.<br>Done since: redaction codes (U.S. FOIA and Privacy Act sets as overlay text, in Redaction properties and `redact_mark`). Redaction cleans indirect and form structure references, preserving surviving form tags. Redaction retires inherited resource dictionaries, so a parent `/Pages` can't keep a removed XObject reachable; unredacted pages are left untouched. Image redaction removes alternate images and unsupported masks only on affected images. Changed marked-content spans lose replacement descriptions; untouched spans keep theirs. Hidden-text cleanup retires unused named descriptions across inherited/shared page and form resources (64 focused tests and scoped Rust 1.96 Clippy/wasm checks pass; publication CI pending). Retained text/image-bearing or unreadable tiling-pattern cells now make Apply refuse atomically after a bounded check of rewritten resources; fully removed cells still apply, and cross-page retention is checked. The redaction audit counts a filled cover that hides half of any one word of a long line (#2662), applied or not. Phone-pattern redaction also matches labelled Italian geographic numbers with `+39` and a slash after the area code (#3205 follow-up); unlabelled international slash numbers remain unsupported. Missing: certificate security, custom redaction code sets and pattern locales, DCT re-encoding |
| M9 | Signatures (PAdES, validation) | 160–280 | 60% | 40–70 | Done: new `sign` crate (DER, X.509, CMS, PKCS #12 on RustCrypto; aws-lc-rs for RSA private keys); PAdES B-B signing (visible, invisible, existing fields, certification with DocMDP); validation with trust store and changes-after-signing classification; self-signed digital IDs; Signatures panel, message bar, sign dialogs; agent tools. Checked with pdfsig and OpenSSL.<br>Done since: macOS Keychain and Windows Current User Personal store signing (software-backed CNG keys), certificate viewer, signed documents protected from rewrites, page validation overlays separate from original signature artwork, placed in the widget's bottom-right corner as it lies on the page, at a quarter of its shorter side and 48 screen points at most, so they annotate the artwork from a corner instead of covering the middle of it and turn with the page and the view (a field falling under 32 screen points, as a page does when zoomed out to fit, keeps its outline), snapshot tabs that reuse instead of multiplying, named-layer signature appearances redrawn for their real state (#79; display, the CLI's render, exports and printing, never saves; captions in the interface language, Chinese in English; the badge stays). Missing: timestamps (B-T), LTV (DSS, OCSP, CRL), FieldMDP, smart cards, PKCS #11 |
| M10 | OCR, create, export, print | 200–350 | 33% | 120–215 | Done: Windows Printer default sends native two-sided bindings only when automatic duplex support is confirmed, preserving manual driver defaults (#5130/#5772); physical output remains unqualified. DocumentDuplex-only bindings use the supported scope through craft-print 9fe50c94. create from blank/text/PNG/JPEG/TIFF (multi-page)/GIF/BMP; export PNG/JPEG/TIFF and text; Print (Acrobat's sizing, n-up, booklet, poster, comments & forms, preview, the CUPS and Windows spoolers, print-ready PDF).<br>Done since: Word, Excel, PowerPoint, OpenDocument and RTF files open from File ▸ Open as new PDFs through an installed LibreOffice (`create.from-office` partial); embedded/72/custom DPI choices for image imports; export all images; OCR (searchable image for pages, ranges and multiple files); single-sided cut-and-stack imposition with cut marks, through Print and doc_print; architectural/ANSI/large ISO sheet presets, Match page at 100% and PDF-scale preview (#599 follow-up); Create PDF from multiple files (PDFs, images and text, edited as pages in the grid); OCR can also read pictures on pages that have text, without adding that text twice (#1028). Model staging fetches SHA-256-verified ONNX detection/recognition files after the upstream RTEN URL brownout; runtime discovery prefers complete ONNX pairs per directory, then complete legacy RTEN pairs, without mixing formats or changing directory precedence. Done since: Word invoice export uses borderless inferred tables, floating positioned text/artwork only where text overlaps an image or is rotated, and per-page sizes, covered by synthetic invoice automation regressions (#773); printing on the web through the browser's print dialog, sheets drawn by PdfCraft (gap 4). Lossless image export applies per-component Decode, including Indexed mapping (#1201 partial). Existing 16-bit precision and color-management limits remain. #3532 partial: vector printing retains existing appearances with absent Subtype through a print-owned Form copy; source artwork stays unchanged. #3120: Office export reads form XObjects 50 levels deep, as the renderer does, and up to 50 000 a page; pages past that are listed in `truncated_pages`. Word table cells use the grid columns they span, including cells after a merged cell. Done since: text in a table slot covered by another cell's span remains as paragraph text in Word, HTML, RTF and PowerPoint. Web OCR downloads its models on first use and reads in Web Workers with SIMD (`ocr.ocr-web`, shipped). Missing: OCR languages beyond Latin, web OCR near native speed, editable-text OCR output, full Office layout fidelity/import. Done since: dotted-leader contents entries stay in separate complete paragraphs (#1757) #2156 candidate: last selected print paper persists across sessions; other print preferences unchanged. Image export applies soft-mask Decode opacity intervals before resizing, including indirect entries and inverted ranges. Vector printing gives annotation appearances unoccupied XObject names so existing page artwork survives. Done since: Enhance scanned file cleans scanned pages in place (background removal, edge shadow removal, despeckle; the OCR text layer and comments stay; #4119 partial). |
| M10 | OCR, create, export, print | 200–350 | 33% | 120–215 | Done: Windows Printer default sends native two-sided bindings only when automatic duplex support is confirmed, preserving manual driver defaults (#5130/#5772); physical output remains unqualified. DocumentDuplex-only bindings use the supported scope through craft-print 9fe50c94. create from blank/text/PNG/JPEG/TIFF (multi-page)/GIF/BMP; export PNG/JPEG/TIFF and text; Print (Acrobat's sizing, n-up, booklet, poster, comments & forms, preview, the CUPS and Windows spoolers, print-ready PDF).<br>Done since: Word, Excel, PowerPoint, OpenDocument and RTF files open from File ▸ Open as new PDFs through an installed LibreOffice (`create.from-office` partial); embedded/72/custom DPI choices for image imports; export all images; OCR (searchable image for pages, ranges and multiple files); single-sided cut-and-stack imposition with cut marks, through Print and doc_print; architectural/ANSI/large ISO sheet presets, Match page at 100% and PDF-scale preview (#599 follow-up); Create PDF from multiple files (PDFs, images and text, edited as pages in the grid); OCR can also read pictures on pages that have text, without adding that text twice (#1028). Model staging fetches SHA-256-verified ONNX detection/recognition files after the upstream RTEN URL brownout; runtime discovery prefers complete ONNX pairs per directory, then complete legacy RTEN pairs, without mixing formats or changing directory precedence. Done since: Word invoice export uses borderless inferred tables, floating positioned text/artwork only where text overlaps an image or is rotated, and per-page sizes, covered by synthetic invoice automation regressions (#773); printing on the web through the browser's print dialog, sheets drawn by PdfCraft (gap 4). Lossless image export applies per-component Decode, including Indexed mapping (#1201 partial). Existing 16-bit precision and color-management limits remain. #3532 partial: vector printing retains existing appearances with absent Subtype through a print-owned Form copy; source artwork stays unchanged. #3120: Office export reads form XObjects 50 levels deep, as the renderer does, and up to 50 000 a page; pages past that are listed in `truncated_pages`. Word table cells use the grid columns they span, including cells after a merged cell. Done since: text in a table slot covered by another cell's span remains as paragraph text in Word, HTML, RTF and PowerPoint. Web OCR downloads its models on first use and reads in Web Workers with SIMD (`ocr.ocr-web`, shipped). Missing: OCR languages beyond Latin, web OCR near native speed, editable-text OCR output, full Office layout fidelity/import. Done since: dotted-leader contents entries stay in separate complete paragraphs (#1757) #2156 candidate: last selected print paper persists across sessions; other print preferences unchanged. Image export applies soft-mask Decode opacity intervals before resizing, including indirect entries and inverted ranges. Vector printing gives annotation appearances unoccupied XObject names so existing page artwork survives. Done since: Enhance scanned file cleans scanned pages in place (background removal, edge shadow removal, despeckle; the OCR text layer and comments stay; #4119 partial). Candidate #4399: The printer picker has a wider searchable list, wrapped device names, stable selection while filtering, and Search and Save as PDF kept visible. Synthetic fleet UI regressions cover long lists and a smaller window. |
| M11 | Optimize, preflight, PDF/A/X/UA, print production | 200–350 | 18% | 80–140 | Done: new `optimize` crate: Reduce File Size and the PDF Optimizer (images measured where drawn, bicubic downsampling, JPEG/ZIP recompression only when smaller, discard objects and user data, Flate clean-up, resource merging, object streams). Target-version compatibility is partial: newer content is not detected or converted. Content stream boundaries preserve comments, split operands and graphics state when image fragments merge. Image downsampling includes page-local `/UserUnit` scaling when measuring physical resolution. Done since: reject invalid image and soft-mask dimensions with checked sizing (#2178); black-and-white images stored losslessly as CCITT Group 4 when smaller, averaged down to 300 ppi above 450 (halftones aside), Group 3 stored again as Group 4, and black-and-white RGB and indexed images that use only palette entries 0 and 1 packed to one bit. Missing: fonts and transparency panels, space audit, preflight, PDF/A/X/UA |
| M8 | Security + redaction | 100–180 | 68% | 15–30 | Done: opening protected documents, permissions, Protect Using Password, Remove security; redaction (mark text/areas/pages, Search & Redact with patterns, apply removing glyphs, image pixels, vectors, XObject content, annotations and fields, verification, full rewrite on save); Remove hidden information and Sanitize.<br>Done since: redaction codes (U.S. FOIA and Privacy Act sets as overlay text, in Redaction properties and `redact_mark`). Redaction cleans indirect and form structure references, preserving surviving form tags. Redaction retires inherited resource dictionaries, so a parent `/Pages` can't keep a removed XObject reachable; unredacted pages are left untouched. Image redaction removes alternate images and unsupported masks only on affected images. Changed marked-content spans lose replacement descriptions; untouched spans keep theirs. Hidden-text cleanup retires unused named descriptions across inherited/shared page and form resources (64 focused tests and scoped Rust 1.96 Clippy/wasm checks pass; publication CI pending). The redaction audit counts a filled cover that hides half of any one word of a long line (#2662), applied or not. Phone-pattern redaction also matches labelled Italian geographic numbers with `+39` and a slash after the area code (#3205 follow-up); unlabelled international slash numbers remain unsupported. Missing: certificate security, custom redaction code sets and pattern locales, DCT re-encoding |
| M9 | Signatures (PAdES, validation) | 160–280 | 60% | 40–70 | Done: new `sign` crate (DER, X.509, CMS, PKCS #12 on RustCrypto; aws-lc-rs for RSA private keys); PAdES B-B signing (visible, invisible, existing fields, certification with DocMDP); validation with trust store and changes-after-signing classification; self-signed digital IDs; Signatures panel, message bar, sign dialogs; agent tools. Checked with pdfsig and OpenSSL.<br>Done since: macOS Keychain and Windows Current User Personal store signing (software-backed CNG keys), certificate viewer, signed documents protected from rewrites, page validation overlays separate from original signature artwork (baked Not Verified captions remain; #79 open), snapshot tabs that reuse instead of multiplying. Missing: timestamps (B-T), LTV (DSS, OCSP, CRL), FieldMDP, smart cards, PKCS #11 |
@@ -406,6 +406,7 @@ Estimates unchanged.
| 2026-10-29 | minor | M2: non-interpolated images drawn below their resolution are area-averaged to whole device pixels instead of nearest-neighbour (scanned text kept one sample in N per axis); page-scan-size images are smoothed when enlarged. Estimates unchanged. |
| 2026-10-27 | minor | M10: OCR stages SHA-256-verified ONNX models after the upstream RTEN URL brownout; discovery prefers a complete ONNX pair per directory, falls back to a complete RTEN pair, and never mixes formats or directories; language/web limits and estimates unchanged. |
| 2026-10-25 | minor | M4, #4594 review: function documentation, stale-notice translation scanning and explicit dependency-policy/shared-release prerequisites; draft behavior and estimates unchanged. |
| 2026-10-25 | minor | M10, #4399: The printer picker has a wider searchable list, wrapped device names, stable selection while filtering, and Search and Save as PDF kept visible. Synthetic fleet UI regressions cover long lists and a smaller window. Estimates unchanged. |
| 2026-10-20 | minor | M9 #79 review, M2, M8: /ActualText that marks no glyph extracts where it paints, as far as it is visible; redaction strips /ActualText around paint it clips; named-layer recognition needs the layer form to draw n1 and n3. Estimates unchanged. |
| 2026-10-25 | minor | M10: vector printing resolves annotation rectangle coordinates; synthetic regression evidence, estimates unchanged. |
| 2026-10-26 | minor | M10: annotation rectangles, coordinates and appearance-state names follow up to 64 indirect references with cycle detection; standalone-object save/reopen and malformed-chain regressions, estimates unchanged. |
+2 -2
View File
@@ -8215,8 +8215,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::a_job_names_its_title_and_owner_to_the_spooler", "crates/print/src/tests.rs::a_job_keeps_the_title_and_owner_it_already_sets", "crates/print/src/tests.rs::a_submitted_job_reaches_lp_named", "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/it/print.rs::print_dialog_shows_the_printer_driver_options", "crates/ui-egui/tests/it/print.rs::printers_listed_in_the_background_preselect_the_default_unless_one_was_picked", "crates/ui-egui/src/workflows/web_print.rs::resolution_falls_with_the_sheet_count_and_long_jobs_are_refused", "crates/ui-egui/src/workflows/web_print.rs::large_sheets_are_drawn_within_the_pixel_cap_and_bad_sizes_are_refused", "crates/ui-egui/src/workflows/web_print.rs::a_sink_error_or_a_page_that_isnt_there_stops_the_job", "crates/print/src/tests.rs::a_command_that_never_answers_is_stopped_at_the_deadline", "crates/ui-egui/tests/it/print.rs::printer_options_are_read_off_the_gui_thread_and_a_dead_read_offers_nothing", "crates/optimize/tests/tiles.rs::a_grid_of_tiles_keeps_its_rows_and_columns_in_place", "crates/engine/src/spooler.rs::a_large_image_goes_to_the_spooler_as_tiles"]
notes = "CUPS queues via lpstat -p -d and driverless destinations without a queue via lpstat -e; on Windows shared craft-print lists the queues (EnumPrinters), the default (GetDefaultPrinter) and each driver's two-sided support in this process, and draws jobs as vectors with Windows.Data.Pdf into the XPS print API with a driver-validated PrintTicket (exact paper, orientation, no scaling; portrait and landscape sheets in one job via /Rotate; an image of more than 2²² pixels as tiles under that size, which Windows.Data.Pdf would draw from a shrunk copy, #5131), starting no PowerShell, so printing works under App Control script enforcement (#1107); the printer list and submission run on workers; 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. On the web: \"Browser's print dialog\" (the default there) reaches the system's printers through the browser; PdfCraft draws the sheets itself (300 dpi up to 100 sheets, 200 up to 300, 150 up to 1,000; at most 64 megapixels a sheet and 1 GiB a job) and prints them from a hidden iframe, one per printed page, a landscape sheet among portrait ones turned onto the paper; copies, two-sided and colour are chosen in the browser's dialog; a browser that refuses to print gets the print-ready PDF as a download. Checked in headless Chromium, not yet in Firefox or Safari; pictures, not vectors; sheets of another paper size print at their own size only where the browser honours named @page sizes (Chromium doesn't). Properties… on CUPS reads the driver options off the GUI thread and gives lpoptions ten seconds before the PPD defaults stand (#1818); on macOS lp jobs also carry the job name and owner (com.apple.print.JobInfo.PMJobName and PMJobOwner) that the system print dialog sends and some vendors' filters need (#5743). Not yet checked on a physical Kyocera printer. The copy sent to the Windows spooler renames every embedded TrueType/OpenType program (name table, /BaseFont, /FontName), because Windows drew a subset's renumbered glyphs with the installed font of the same name and printed shifted letters (#3132); not yet checked on a physical Windows printer."
evidence = ["crates/print/src/tests.rs::spooler_arguments_and_printer_list", "crates/print/src/tests.rs::a_job_names_its_title_and_owner_to_the_spooler", "crates/print/src/tests.rs::a_job_keeps_the_title_and_owner_it_already_sets", "crates/print/src/tests.rs::a_submitted_job_reaches_lp_named", "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/it/print.rs::print_dialog_shows_the_printer_driver_options", "crates/ui-egui/tests/it/print.rs::printers_listed_in_the_background_preselect_the_default_unless_one_was_picked", "crates/ui-egui/src/workflows/web_print.rs::resolution_falls_with_the_sheet_count_and_long_jobs_are_refused", "crates/ui-egui/src/workflows/web_print.rs::large_sheets_are_drawn_within_the_pixel_cap_and_bad_sizes_are_refused", "crates/ui-egui/src/workflows/web_print.rs::a_sink_error_or_a_page_that_isnt_there_stops_the_job", "crates/print/src/tests.rs::a_command_that_never_answers_is_stopped_at_the_deadline", "crates/ui-egui/tests/it/print.rs::printer_options_are_read_off_the_gui_thread_and_a_dead_read_offers_nothing", "crates/optimize/tests/tiles.rs::a_grid_of_tiles_keeps_its_rows_and_columns_in_place", "crates/engine/src/spooler.rs::a_large_image_goes_to_the_spooler_as_tiles", "crates/ui-egui/tests/it/print.rs::printer_picker_filters_a_large_fleet_without_changing_the_selection", "crates/ui-egui/tests/it/print.rs::printer_picker_keeps_save_as_pdf_available_when_the_filter_matches_nothing", "crates/ui-egui/tests/it/print.rs::printer_picker_scrolls_long_names_without_losing_the_search_or_pdf_choice"]
notes = "The printer menu is wider and taller, filters names without regard to case, and wraps long names; search and Save as PDF remain visible while devices scroll (#4399). Filtering does not choose a destination and clears when the menu reopens. CUPS queues via lpstat -p -d and driverless destinations without a queue via lpstat -e; on Windows shared craft-print lists the queues (EnumPrinters), the default (GetDefaultPrinter) and each driver's two-sided support in this process, and draws jobs as vectors with Windows.Data.Pdf into the XPS print API with a driver-validated PrintTicket (exact paper, orientation, no scaling; portrait and landscape sheets in one job via /Rotate; an image of more than 2²² pixels as tiles under that size, which Windows.Data.Pdf would draw from a shrunk copy, #5131), starting no PowerShell, so printing works under App Control script enforcement (#1107); the printer list and submission run on workers; 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. On the web: \"Browser's print dialog\" (the default there) reaches the system's printers through the browser; PdfCraft draws the sheets itself (300 dpi up to 100 sheets, 200 up to 300, 150 up to 1,000; at most 64 megapixels a sheet and 1 GiB a job) and prints them from a hidden iframe, one per printed page, a landscape sheet among portrait ones turned onto the paper; copies, two-sided and colour are chosen in the browser's dialog; a browser that refuses to print gets the print-ready PDF as a download. Checked in headless Chromium, not yet in Firefox or Safari; pictures, not vectors; sheets of another paper size print at their own size only where the browser honours named @page sizes (Chromium doesn't). Properties… on CUPS reads the driver options off the GUI thread and gives lpoptions ten seconds before the PPD defaults stand (#1818); on macOS lp jobs also carry the job name and owner (com.apple.print.JobInfo.PMJobName and PMJobOwner) that the system print dialog sends and some vendors' filters need (#5743). Not yet checked on a physical Kyocera printer. The copy sent to the Windows spooler renames every embedded TrueType/OpenType program (name table, /BaseFont, /FontName), because Windows drew a subset's renumbered glyphs with the installed font of the same name and printed shifted letters (#3132); not yet checked on a physical Windows printer."
[[feature]]
id = "print.copies-collate"