M4.62: PDF/.ai layers from optional content: named layers with visibility, print state and lock; art that is off as hidden layers

Optional content groups become layers (in paint order, shared by every page)
with their name, default visibility, print usage and lock; art outside them
goes to a layer per page. Art that is off isn't lost: an update appended to
the file drops its /OCProperties so the interpreter draws every group, and
the marked-content sequences found walking the content (checked by tag) route
the art to its group's layer, which comes in hidden. A form hidden by its own
/OC keeps the file as it is. document.open layers: false keeps one layer per
page of only what shows (Save then asks for a name).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-05 13:05:12 +07:00
co-authored by Claude Opus 5.5
parent a51083733e
commit 8046b9be84
10 changed files with 586 additions and 87 deletions
+4 -2
View File
@@ -240,10 +240,12 @@ the backdrop colour gives Clip, an inverting transfer function Invert), transpar
tiling patterns become pattern swatches, patch and triangle mesh shadings become gradient meshes, and gradients keep
their stop opacity and stop where the shading doesn't extend. Text becomes point type, one object per run of a line in
the file's font (by name; fonts that aren't available are listed in `warnings` and show in the fallback font) —
`textAs: "outlines"` keeps glyph outlines instead:
`textAs: "outlines"` keeps glyph outlines instead. Optional content groups (the layers of PDF and PDF-compatible `.ai`
files) become layers with their name, visibility, print state and lock, art that is off coming in as a hidden layer;
art outside them goes to a layer per page. `layers: false` gives one layer per page of only what shows:
```json
{"name":"run_command","arguments":{"command":"document.open","params":{"path":"/tmp/map.pdf","textAs":"outlines"}}}
{"name":"run_command","arguments":{"command":"document.open","params":{"path":"/tmp/map.pdf","textAs":"outlines","layers":false}}}
```
Preserve Editing (`preserveEditing`, on in the `VectorCraft Default` preset) embeds the native document in the PDF as