Skip to content

Part of #637: Illustrator EPS and .ai files open from their editing data - #717

Closed
bflatastic wants to merge 1 commit into
mainfrom
feat/637-editing-data
Closed

bflatastic wants to merge 1 commit into
mainfrom
feat/637-editing-data

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Illustrator EPS files (version 9 on) and .ai files (PDF compatible or not) now open from the editing data they carry, instead of the printed EPS page or the PDF-compatible part.

Reading the data (crates/eps/src/import/ai/)

  • EPS: %AI9_PrivateDataBegin … %AI9_PrivateDataEnd after the page: header comments, then %AI24_DataStream (Zstandard) or %AI9_DataStream (zlib) as ASCII85 comment lines, or the data as it is.
  • .ai: the first page's /PieceInfo /Illustrator /Private AIPrivateData1…N streams joined (vectorcraft_pdf::ai_private_data): %AI24_ZStandard_Data, %AI12_CompressedData (after header comments) or plain.
  • Zstandard through ruzstd (already in the workspace, pure Rust, builds for wasm).

What comes through

  • Layers and sublayers: names, order, visibility, lock, printing, preview, dimming, colour (preset or custom).
  • Groups and nesting, compound paths, clipping groups (clipping path first) and layer clipping.
  • Object names (AIArtName, or the XML id decoded: My_Rect__x23_2 → "My Rect Docs: workflow fixes from #1 (README, control protocol) #2"), hidden and locked objects.
  • Fills and strokes: grey, CMYK, RGB, named and spot colours (spot swatches), width, caps, joins, miter, dashes, fill rule, overprint.
  • Linear and radial gradients (stops with opacity and midpoints, the gradient's placement and focal point).
  • Opacity, blend modes, isolation and knockout, on objects and groups.
  • Embedded images (grey, RGB, CMYK, 1-bit; their alpha channel), guides.
  • Every artboard where it is (the ArtboardArray; older files: crop marks, or the art size around the template box).
  • Objects with several fills or strokes, effects or brushes: their drawn look (a group), named after the object, with a warning.

Not yet (the file opens as before, the EPS page or the .ai file's PDF content, with a first warning naming what): type, symbols, pattern fills, placed (linked) files, legacy-format type, any operator the reader doesn't know. Appearances and live effects are drawn, not editable. A .ai opened with pages picked, and a .pdf, read the PDF as before. A .ai from Illustrator still isn't saved over (Save asks for a new file), as before.

Tests

  • eps unit tests on hand-written editing data: layers, groups and names, colours and strokes, compound and clipping, transparency, gradients, artboards, drawn looks, images with alpha, skipped sections, errors, hostile input, both EPS codecs and the three .ai encodings.
  • engine (tests_aiimport.rs): a synthetic sample (vectorcraft_testkit::ai) opened as EPS and as .ai, saved as EPS and reopened; the fallbacks and their warnings.
  • import_fuzz: hostile editing data (operators, sections and dictionaries in any order) and mutated data, plain and compressed, through EPS and .ai.
  • New messages in the es, fr, it and ru catalogs; ROADMAP and docs/mcp.md updated.

🤖 Generated with Claude Code

An Illustrator EPS (version 9 on) carries the document as the app keeps
it after its printed page (%AI9_PrivateDataBegin: Zstandard or zlib data
in ASCII85 comment lines, or plain), and a .ai file in its first page's
/PieceInfo /Illustrator /Private streams (%AI24_ZStandard_Data,
%AI12_CompressedData or plain, after header comments). Both now open from
it: layers and sublayers (name, order, visibility, lock, printing,
preview, dimming, colour), groups as they were nested, compound paths,
clipping groups and layer clipping, object names, hidden and locked
objects, fills and strokes (grey, CMYK, RGB, spot colours as spot
swatches, caps, joins, dashes, fill rule), linear and radial gradients,
opacity, blend modes, isolation and knockout, embedded images with their
alpha channel, guides and every artboard where it is.

Objects with several fills or strokes, effects or brushes come in as
their drawn look, named after them, with a warning. Type, symbols,
pattern fills, placed files and operators the reader doesn't know are
errors: the file opens as before (the EPS page, the .ai file's PDF
content) with a first warning saying what was left out. A .ai opened with
pages picked, and a .pdf, read the PDF as before.

Reading is bounded (512 MB decompressed, nesting, objects, points, stack,
image sizes checked against their data) and fuzzed in import_fuzz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic marked this pull request as draft October 9, 2026 08:03
@bflatastic

Copy link
Copy Markdown
Member Author

Superseded by #727, which builds this reader on top of #715.

@bflatastic bflatastic closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant