#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 <nrq6993-a11y@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-10-22 00:54:43 +07:00
committed by bflatastic
co-authored by nrq6993-a11y
parent a5c0c29b25
commit 1824829931
2 changed files with 12 additions and 1 deletions
+6
View File
@@ -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.
+6 -1
View File
@@ -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}");
}