feat: PRINT command — send layout to system printer via lp/lpr

The PRINT command renders the current layout to a temporary PDF (reusing
the existing PDF export pipeline) and dispatches it to the OS default
printer:
  - Linux/macOS: `lp` (CUPS) with `lpr` as fallback.
  - Windows: ShellExecute "print" verb (compiled-in, unused on Linux).

PLOT and EXPORT still open the save-file dialog as before.
Status messages are shown in the command line during the async job.

Closes ROADMAP 1.8.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-08 22:21:50 +03:00
commit f515b556c7
5 changed files with 191 additions and 1 deletions

View file

@ -3794,9 +3794,13 @@ impl H7CAD {
}
// ── Plot / Page Setup ──────────────────────────────────────────
"PRINT"|"PLOT"|"EXPORT" => {
"PLOT"|"EXPORT" => {
return Task::done(Message::PlotExport);
}
// PRINT — send current layout to the system default printer.
"PRINT" => {
return Task::done(Message::PrintToPrinter);
}
// PLOTSTYLE — load or clear CTB/STB plot style table
cmd if cmd == "PLOTSTYLE" || cmd.starts_with("PLOTSTYLE ") => {
let sub = cmd.split_once(' ')