mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 21:57:12 -06:00
M4.38: native and .ai save options: each artboard to its own file, linked files, ICC profiles, PDF content
- document.save / Save As / Save a Copy to a native or .ai file take separateArtboards + range (also write <name>-<artboard>.<ext> per artboard beside the master file, holding that artboard and the art touching it; the result lists every file), includeLinked (linked images keep their files' own pixels), embedProfiles (ICC profiles loaded from files that the document is tagged with; opening installs them where missing) and pdfCompatible (native: also carry a PDF of every artboard; .ai: false writes blank pages around the native document). .ai files also take compress (compression.compressText). - File > Save As to a native or .ai file shows the options dialog (VectorCraft Options) after the save panel: Save each artboard to a separate file (All or a range), Include Linked Files, Embed ICC Profiles, Create PDF-Compatible File, Use Compression, Preview; the web's Save As dialog shows them too. Save, Save a Copy and Save as Template reuse the options as last saved. - Format: optional "profiles" and "pdf" members (load_file, pdf_content), SaveOptions.include_linked/profiles/pdf; files without them are unchanged. - Changed test: tests_aisave::save_as_ai_writes_a_pdf_that_reopens_editable now confirms the options dialog Save As .ai shows before writing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
975067b44a
commit
bf4614669e
@@ -346,3 +346,9 @@ saved}]`, from `file.recovery.list`) and `discard`. `ui.dialog.confirm` restores
|
||||
each, opening "<name> [Recovered]" documents), `discard: true` then confirm deletes them, `ui.dialog.cancel` keeps them
|
||||
for the next launch. While copies are written in the background `ui.inspect` lists them under `background`
|
||||
("Saving recovery data for <name>").
|
||||
|
||||
Native save options: File → Save As to a native or `.ai` file opens the `saveOptions` dialog after the save panel
|
||||
(heading "VectorCraft Options" or "PDF-compatible .ai Options"). Fields: `separateArtboards`, `all` (true: every
|
||||
artboard; false: `range`, such as "1-3, 5"), `includeLinked`, `embedProfiles`, `pdfCompatible`, `compress`, and for
|
||||
native files `version` and `preview`. A bad range keeps the dialog open; `ui.dialog.confirm` writes the file and the
|
||||
artboards' files.
|
||||
|
||||
+23
@@ -1291,3 +1291,26 @@ folder or browser storage the commands are disabled and say how to set one.
|
||||
{"name":"run_command","arguments":{"command":"file.recovery.save","params":{}}}
|
||||
{"name":"run_command","arguments":{"command":"file.recovery.restore","params":{"file":"1759650000-1/Poster-1"}}}
|
||||
```
|
||||
|
||||
## Native save options
|
||||
|
||||
`document.save` / `file.saveAs` / `file.saveCopy` to a native (`.vectorcraft`, `.vctemplate`) or `.ai` file take, flat
|
||||
or in `options` (`file.formatOptions {format}` lists them with their values):
|
||||
|
||||
- `separateArtboards: true` also writes each artboard of `range` (`"1-3, 5"`, default `"all"`) to
|
||||
`<name>-<artboard>.<ext>` beside the file: that artboard and the art touching it. The result's `files` lists every
|
||||
file written, the master file first (without a path: `files: [{name, dataBase64}]`). 3 artboards give 4 files.
|
||||
- `includeLinked: true` keeps linked images' own pixels in the file (they stay linked), not just the previews.
|
||||
- `embedProfiles` (default true) carries the ICC profiles the document is tagged with that were loaded from files;
|
||||
opening the file installs them where they are missing (a warning names one that can't be used).
|
||||
- `pdfCompatible`: native files (default false) also carry a PDF of every artboard (`pdf` in the file); `.ai` files
|
||||
(default true) with false write blank pages around the native document (smaller; other apps show empty pages).
|
||||
- `.ai` only: `compress` (default true) is the PDF option `compression.compressText`.
|
||||
|
||||
File → Save As asks for these in the save options dialog (VectorCraft Options) after the save panel; Save, Save a Copy
|
||||
and Save as Template reuse the options as last saved (or Use Compression).
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"file.saveAs","params":{"path":"/tmp/set.vectorcraft","separateArtboards":true,"range":"2-3","includeLinked":true}}}
|
||||
{"name":"run_command","arguments":{"command":"file.saveAs","params":{"path":"/tmp/set.ai","pdfCompatible":false}}}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user