Scripts: explicit crop boxes, EPS close-with-save and writer receivers checked per call

- document.open with an explicit PDFCROPBOX crop opens on the crop box
  of a file with editing data; the default keeps the trim box and bleed.
- Closing with save changes keeps an EPS document's artboard range, since
  the EPS file holds the whole document.
- The script checker treats a writer receiver captured from an outer
  scope as able to change before each call, and finds the loop that holds
  a call with a binary search instead of a scan of every loop.
This commit is contained in:
dotCooCoo committed 2026-11-29 19:01:56 -08:00
1 parent f99ef023ad
commit 82d4ec4336
6 files changed
+170 -7

No files matched your search

+5 -1
View File
@@ -939,8 +939,12 @@ const SAVES_SOME_ARTBOARDS: &str =
/// Whether the file that saving `st` with its remembered options writes would omit artboards. A
/// PDF with `useArtboards: false` holds one page of the art's bounds. A native file, or a `.ai`
/// file other than a legacy version 7 one, with `separateArtboards` holds every artboard, and its
/// `range` names only the separate files.
/// `range` names only the separate files. An EPS file embeds the whole document in its main file,
/// so its `artboardRange` never omits an artboard from what reopens.
fn picks_artboards(st: &crate::doc_state::DocState) -> bool {
if st.format == "eps" {
return false;
}
let options = Value::Object(crate::cmd::fileio::remembered_save_options(st));
if matches!(st.format, "svg" | "svgz") && crate::cmd::fileio::svg_lost_artboards_warning(&st.doc, &options, st.format).is_some() {
return true;