forked from 1b-agent/opencadstudio-upstream
Phase 7: Plot settings and PDF export
- Add printpdf 0.9.1 dependency for native PDF generation. - New src/io/pdf_export.rs: converts paper-space WireModels to a PDF page (per-wire stroke color, line weight in Pt, NaN-split segments). White/near-white colors are inverted to black for print output. - Add PlotExport / PlotExportPath messages: opens a save-file dialog and writes a .pdf next to the drawing file. - Add PageSetupOpen/Close/WidthEdit/HeightEdit/Commit messages: a centered modal panel lets the user enter paper width and height (mm); on commit the Layout object's min/max_limits are updated in-place. - Register PRINT / PLOT / EXPORT and PAGESETUP (PS) commands in dispatch_command; fix MVIEW error message to English. - Layout ribbon gains a "Plot" group with Page Setup and Export PDF ribbon buttons. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
ace83a0953
commit
e1d296da10
9 files changed
+1642
-143
No files matched your search
@@ -3,7 +3,7 @@
|
||||
|
||||
pub mod mview;
|
||||
|
||||
use crate::modules::{CadModule, RibbonGroup};
|
||||
use crate::modules::{CadModule, IconKind, ModuleEvent, RibbonGroup, ToolDef};
|
||||
|
||||
pub struct LayoutModule;
|
||||
|
||||
@@ -16,9 +16,30 @@ impl CadModule for LayoutModule {
|
||||
}
|
||||
|
||||
fn ribbon_groups(&self) -> Vec<RibbonGroup> {
|
||||
vec![RibbonGroup {
|
||||
title: "Viewport",
|
||||
tools: vec![mview::tool().into()],
|
||||
}]
|
||||
vec![
|
||||
RibbonGroup {
|
||||
title: "Viewport",
|
||||
tools: vec![mview::tool().into()],
|
||||
},
|
||||
RibbonGroup {
|
||||
title: "Plot",
|
||||
tools: vec![
|
||||
ToolDef {
|
||||
id: "PAGESETUP",
|
||||
label: "Page Setup",
|
||||
icon: IconKind::Glyph("📋"),
|
||||
event: ModuleEvent::Command("PAGESETUP".to_string()),
|
||||
}
|
||||
.into(),
|
||||
ToolDef {
|
||||
id: "PLOT",
|
||||
label: "Export PDF",
|
||||
icon: IconKind::Glyph("🖨"),
|
||||
event: ModuleEvent::Command("PLOT".to_string()),
|
||||
}
|
||||
.into(),
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user