Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

#3343: recognize PageMaker .pmd on open with a clear message

Cursor Agent1824829931a3
diff --git a/crates/engine/src/cmd/fileio/dxf.rs b/crates/engine/src/cmd/fileio/dxf.rs
index c13b4fdb8..f0bb1f400 100644
--- a/crates/engine/src/cmd/fileio/dxf.rs
+++ b/crates/engine/src/cmd/fileio/dxf.rs
@@ -94,6 +94,12 @@ pub const UNSUPPORTED: &[Unsupported] = &[
extensions: &["pict", "pct", "pic"],
hint: "PICT is a retired format and is not supported: convert the file to PDF or PNG first",
},
+ Unsupported {
+ id: "pmd",
+ label: "PageMaker",
+ extensions: &["pmd"],
+ hint: "PageMaker (.pmd) is not supported: open the layout in PageMaker and export PDF or EPS, or place a PDF export here",
+ },
];
/// The unsupported format an id or extension (any case, leading dot allowed) names.
diff --git a/crates/engine/src/cmd/fileio/tests_dxf.rs b/crates/engine/src/cmd/fileio/tests_dxf.rs
index ab817c6dc..f31b8d721 100644
--- a/crates/engine/src/cmd/fileio/tests_dxf.rs
+++ b/crates/engine/src/cmd/fileio/tests_dxf.rs
@@ -169,7 +169,7 @@ fn formats_list_dxf_and_what_can_not_be_written() {
}
assert!(r["writable"].as_array().unwrap().contains(&json!("dxf")));
let unsupported: Vec<&str> = r["unsupported"].as_array().unwrap().iter().map(|u| u["id"].as_str().unwrap()).collect();
- assert_eq!(unsupported, ["dwg", "pict"]);
+ assert_eq!(unsupported, ["dwg", "pict", "pmd"]);
}
#[test]
@@ -191,4 +191,9 @@ fn dwg_and_pict_say_what_to_use_instead() {
.unwrap_err()
.to_string();
assert!(e.contains("DWG is not available"), "{e}");
+ let e = s
+ .execute("document.open", &json!({"name": "brochure.PMD", "dataBase64": vectorcraft_format::base64_encode(b"PageMaker")}))
+ .unwrap_err()
+ .to_string();
+ assert!(e.contains("brochure.PMD") && e.contains("PageMaker"), "{e}");
}