From 1824829931a30ffa798bbe50d103e9c237776d04 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 21 Oct 2026 15:51:09 +0000 Subject: [PATCH] #3343: recognize PageMaker .pmd on open with a clear message ## Summary Opening or placing a .pmd file now fails with a dedicated unsupported-format hint (like DWG and PICT), telling users to export PDF or EPS from PageMaker instead of a generic unknown-format error. document.formats lists PageMaker in its unsupported table. ## Tests - formats_list_dxf_and_what_can_not_be_written - dwg_and_pict_say_what_to_use_instead (includes brochure.PMD open) Part of storytold/vectorcraft#3343 Co-authored-by: nrq6993-a11y --- crates/engine/src/cmd/fileio/dxf.rs | 6 ++++++ crates/engine/src/cmd/fileio/tests_dxf.rs | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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}"); }