From 06221726fbdae0be39d425add74e50b31e49e9b1 Mon Sep 17 00:00:00 2001 From: Dan Green Date: Tue, 13 Oct 2026 18:25:07 -0700 Subject: [PATCH] Part of #868: legacy .ai defines annotatepage in a prolog of its own The page trailer the version 7 specification gives (section 3, Script Setup) is `gsave annotatepage grestore showpage`, and annotatepage is a procedure of the app's own prolog, which the file didn't have. The file now carries a procedure set of the writer's own (VectorCraft_Legacy 1 0, listed in %%DocumentSuppliedResources) in a dictionary the setup begins and the trailer ends, which defines annotatepage as marking nothing. --- crates/eps/src/legacy_ai.rs | 29 +++++++++++++++++++++++++---- crates/eps/src/tests_legacy_ai.rs | 8 ++++++-- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/crates/eps/src/legacy_ai.rs b/crates/eps/src/legacy_ai.rs index 6904fb0d5..4b774c2f7 100644 --- a/crates/eps/src/legacy_ai.rs +++ b/crates/eps/src/legacy_ai.rs @@ -51,8 +51,10 @@ //! Windows-1252, vertical type, inline graphics, gradient or pattern fills) is written as its //! outlines, and all type with [`LegacyAiOptions::outline_text`]. //! -//! No prolog is written: the file names none, so PostScript printers can't print it, as the `.ai` -//! files other apps write in this format. +//! The prolog defines the one procedure the script calls that isn't an operator of the format, +//! the page trailer's `annotatepage` ([`PROLOG`]); the format's operators are left to the app that +//! reads the file, so PostScript printers can't print it, as the `.ai` files other apps write in +//! this format. use std::fmt::Write; use std::sync::Arc; @@ -196,7 +198,11 @@ pub fn export_legacy_ai(doc: &Document, o: &LegacyAiOptions) -> Result Result