Commit Graph
29 Commits
Author SHA1 Message Date
dotCooCoo ba27846c2a Merge main into feat/print-per-job-settings 2026-12-04 01:02:33 -08:00
dotCooCoo b32285d451 Tests: cover script DOM range checks, PrintOptions groups and evalFile refusals
- The text attribute test has rows one step past the bounds of
  baselineShift, horizontalScale, verticalScale and rotation.
- A new print test prints each PrintOptions group (overprints, page
  marks, orientation, separations, custom and transverse paper, emulsion,
  negative and position) through Document.print and compares the
  PostScript with what file.print writes for the matching settings,
  leaving out the CreationDate comment. Each case also checks that its
  settings change the file. The color intent is compared in PDF, by the
  art the printed file opens as.
- A new include test reads a refused absolute path whose URI-decoded form
  is not read either, and checks that $.evalFile keeps the refusal.
2026-12-02 22:13:01 -08:00
dotCooCoo 7f64fc6619 Merge main into feat/print-per-job-settings 2026-12-02 11:40:15 -08:00
.CooCoo 491d1324cf Merge pull request #10572 from dotCooCoo/fix/pg9087-3
Print: maxPages turns a job away before raster effects are flattened
2026-12-02 11:09:01 -08:00
dotCooCoo 5886c70c8d Print: maxPages turns a job away before raster effects are flattened
file.print with maxPages flattened every raster effect in the document
before it counted the pages, so a job it then turned away still paid
for rendering each effect. The page count from the artboards now runs
first, on the artboards alone, and raster effects are flattened only
for a job that fits.

Follows up on #9087.
2026-12-02 05:55:33 -08:00
dotCooCoo d359bb7e1a Print: Document.print throws for CUSTOMPROFILE without a profile name
A script that set PrintColorManagementOptions.colorProfileMode to
CUSTOMPROFILE and assigned no name printed with the base settings'
profile, as though no custom profile had been asked for. The job now
throws before anything is written, as it does for an empty name.

Follows up on #9087.
2026-12-02 05:13:50 -08:00
dotCooCoo 80a3f65798 Print: keep the branch to Print as Bitmap's resolution
- The print option classes list their members in reflect as #9060
  lists them; the rule that left out unmapped options came from an
  earlier merge of main and is not part of this change.
- Document.tags keeps its place after print in the Document members,
  as on main.
2026-12-01 20:24:18 -08:00
dotCooCoo 24bd16d3c2 Merge feat/scripts-api-d10-print-options into feat/print-per-job-settings
# Conflicts:
#	crates/engine/src/script/dom.rs
#	crates/engine/src/script/dom/print.rs
#	crates/engine/src/tests/script_print.rs
2026-12-01 20:03:46 -08:00
dotCooCoo 784491b1bd Merge main into feat/scripts-api-d10-print-options 2026-12-01 14:13:21 -08:00
dotCooCoo e08f8dddf3 Scripts: print options check values as file.print takes them
- An option that is not mapped accepts only its exact default, so
  `bitmapResolution = 0.0000000005` throws that it is not available.
- Paper `width` and `height` take 0 or 72 to 14,400 pt, checked when they
  are assigned, as `file.print` requires for a custom size.
- An assigned `position` places an untiled job when the base settings hold
  a placed Print Tiling origin. The saved settings keep the origin.
- The `app.open` size limit in docs/mcp.md is the 128 MiB a script command
  reads, with the 256 MiB error above that.
- The backslash file name test asserts the result of each platform, and
  the printArea test checks that the page is artboard 2.
2026-12-01 07:31:36 -08:00
dotCooCoo 0c13a1edb2 Scripts: close the review gaps in print, saveAs, File paths and presets
- The 1000% scale limit applies only when Fit to Page is off, since the
  scale factors are not used with it on.
- A script run clears the print command allowance when it ends, so a
  panic inside print cannot leave file.print open to later runs.
- saveAs without options takes the format from the path the script
  names, so a link at that path cannot change it.
- A File the host gives back charges its path to the heap.
- DocumentPreset.typename throws for a preset from an earlier run.
- Documents.addDocumentNoUI throws that it is not available yet.
- The print tests remove their folders when an assertion fails.
2026-11-30 14:54:47 -08:00
dotCooCoo f44ecb3741 Scripts: refusals name files as the save was given them; locked folders give READ_ONLY_LOCATION
A save job now takes its path naming from whether the plan was given a
path, so a refused multi-file save without a path names its files by
their file names for every caller of `save_job`, as `document.save`
already did. Merging the save, export and open branch had left the job
naming full paths unless `save` set the field, which failed
`refused_multi_file_save_never_calls_the_writer`.

A multi-file save or export into a folder that may not be read no
longer fails with "automation path rejected: cannot resolve": a path
whose real path cannot be found is compared as written, and its write
reports READ_ONLY_LOCATION as other saves there do.

The print tests remove their folders when an assertion fails, and Check
Script has a test for printing the document `app['open']` returns.
2026-11-30 14:48:45 -08:00
dotCooCoo 6c8bf23132 Merge feat/scripts-api-d10-print-options into feat/print-per-job-settings
Takes the script File design with native slots, Document.fullName,
path, saved and close, and Check Script's reading of bracketed document
chains. PrintJobOptions.bitmapResolution stays mapped to
advanced.bitmapResolution, and the print option classes keep main's
reflect rules for unmapped properties.
2026-11-30 10:00:51 -08:00
dotCooCoo 7da1dc0750 Scripts: save, print, export and app.open check names and sizes first
A multi-file save whose destination fails the access check now returns
that error without calling the writer. app.open refuses a document
larger than 256 MiB, checked from the file's size and again while the
file is read. On Windows, print and exportFile read the format from the
file name with trailing dots and spaces removed, as saveAs does. The
script checker reports app.open and app['open'] as file reads.
2026-11-29 16:01:40 -08:00
dotCooCoo 9fb8974575 fmt: format the print and save script changes 2026-11-29 14:28:06 -08:00
dotCooCoo e916bef125 Scripts: print and save options follow what the script assigned
- An assigned empty artboardRange prints every artboard instead of the saved range.
- Save and export refuse two destinations that resolve to the same file.
- Script file paths that are not valid UTF-8 are refused.
- PrintJobOptions.file keeps the assigned File, so a later name change is printed to.
- app.open of a template link opens an untitled copy.
- CUSTOMPROFILE with no profile assigned or saved is refused before printing.
- A destination named .ps writes PostScript.
- The save description limits its no-write guarantee to failures found before writing.
2026-11-29 13:42:47 -08:00
dotCooCoo 15ea1ad7f1 Scripts: a panic during print closes the script fence again
Document.print opens the fence for file.print and closes it after the
command returns. A panic in that command skipped the close, so a later
run in the same session could call vc.run('file.print'). The end of
each run slice now clears the marker together with script_in_run.
2026-11-29 10:16:08 -08:00
dotCooCoo a666185cc6 Scripts: fix print, save and export gaps found after merging main
- PrintJobOptions.file reads back as a File that can be assigned again.
- Document.saveAs picks the format from the supplied name before following
  a link, trims the trailing dots and spaces Windows ignores, and keeps the
  .ai, .eps and .pdf rule for a name that is only a dot and an extension.
- A save or export that writes several files refuses a target that is not
  a regular file before any file is written, with the usual path redaction.
- Document.saveAs, Document.exportFile and app.open send command warnings
  to the Script Console.
- fitToPage = false keeps a base tiling mode and clears only a base fit.
- The print scale factors take 1 to 1000 at assignment.
- File and Folder keep their state in native slots, so an object made from
  File.prototype with a path property is refused as before, and logging,
  localize() and toSource() still read their own properties.
- bitmapResolution declares a finite maximum, so its reflection matches.
- The two new script file messages are English only.
2026-11-28 21:21:19 -08:00
dotCooCoo 976f1a4d91 Merge main into feat/print-per-job-settings
Ports the print option classes to main's reflected members; reflect leaves out the options that take only their default.
2026-11-28 20:08:31 -08:00
dotCooCoo 25f3f4d24f Print: file.print turns down a null maxPages instead of printing without a limit 2026-11-24 17:53:31 -08:00
dotCooCoo 8005f77c4c Merge feat/scripts-api-d10-print-options into feat/print-per-job-settings 2026-11-24 16:16:17 -08:00
dotCooCoo 0830cd1695 Scripts: print writes level 2 PostScript when postScriptLevel is not assigned
A PrintPostScriptOptions object reads postScriptLevel as PSLEVEL2, its
help page's default, but a job written to a .ps file without that
property assigned sent no level to file.print, which wrote level 3.
Document.print now sends level 2 for every PostScript job unless
PSLEVEL3 is assigned.

The print test checks the %%LanguageLevel comment of an unassigned .ps
job (2) and of a job with PSLEVEL3 assigned (3). docs/mcp.md and the
module notes state the default.
2026-11-22 06:51:37 -08:00
dotCooCoo 8c46fd5cab Merge feat/scripts-api-d10-print-options into feat/print-per-job-settings 2026-11-22 06:15:29 -08:00
dotCooCoo a704798119 Scripts: printer jobs count pages from the art as it prints, and app['open'] gives a document
- Document.print to a printer no longer counts pages with print.preview,
  which leaves out artboard backgrounds and placed files. It passes
  file.print a new maxPages param: file.print counts the pages of the art
  it prints and composes nothing when the job has more, answering
  {pages, format}. An artboard that holds only its background now prints
  with skipBlank, and a job turned away by the sheet limit is not
  composed. When the pages follow from the artboards alone, the count is
  checked before Print as Bitmap or a flattener preset prepares the art,
  after the level and the flattener preset are checked.
- The printers a run lists keep the system's default printer when it
  comes after the first 256 (it takes the last place), and a repeated
  name keeps a later default mark without a second entry.
- The script checker reads app['open'](f) as giving a document, as
  app.open(f) does, so a print of the variable that holds it counts as a
  file write.
- The print job test checks the artwork in each prepared job, not only
  that the two jobs differ.

Docs: docs/mcp.md (maxPages, the page count, the default printer),
docs/roadmap.md M13 row.
2026-11-22 02:39:54 -08:00
dotCooCoo 7b2b919f41 Print: Print as Bitmap prints at advanced.bitmapResolution
advanced.bitmapResolution sets the resolution Print as Bitmap renders a
composite page at, in a print-ready PDF and in PostScript. 0, the
default, keeps the document's raster effects resolution; 1 to 9600 ppi
is VectorCraft's own range, and print.setup, print.preview and
file.print refuse any other value. Given in file.print's settings it
applies to that job only; print.setup saves it with the document. The
Print dialog's Advanced section sets it under Resolution.

When the pixel limits (64 million pixels, 32,768 a side) keep a page's
image below the requested resolution, file.print and print.preview
warn with the resolution it prints at. A page that prints no image
gets no warning.

A script's PrintJobOptions.bitmapResolution now maps to it instead of
throwing.
2026-11-22 01:34:55 -08:00
dotCooCoo 619ccb2a34 Merge feat/scripts-api-d10-print-options into feat/scripts-print-printer 2026-11-22 01:08:19 -08:00
dotCooCoo b2d458f667 Scripts: print lists in the host name check, applies range and print area over saved settings
- The host name check lists Document.print as a file write, and app's
  print lists, PrintOptions, its option classes and the printing
  enumerations as names that stay inside the run.
- The script checker reports a file write for print called on a
  document: app.activeDocument, app.documents[i], documents.add(),
  documents.getByName() and app.open(), or a variable that holds one.
  A print method of any other object is not reported.
- An assigned artboardRange without printAllArtboards replaces the saved
  range. An assigned printArea prints by artboard when the saved
  settings, or the preset's, ignore the artboards: the assigned range,
  or each artboard.
- The two scale factors are linked only when they are equal, as
  file.print compares them.
- The format follows the name jobOptions.file gives, also when that
  name is a link to a file with another extension.
- A print option name with a control character at either end throws.
2026-11-21 21:01:41 -08:00
dotCooCoo b965a3ef1f Scripts: Document.print sends to a printer after the run and the person's approval, and app.printerList lists printers
Document.print without jobOptions.file now prints to the printer that
PrintOptions.printerName names, or to the default printer. A run started
in the app gets a bounded list of the print service's printer names
(at most 256, names up to 512 bytes, no control characters), and
app.printerList gives a Printer object for each. A name must match a
listed printer exactly.

print composes each job as a print-ready PDF and holds it until the
run ends. When the run's changes are kept, a dialog lists each job's
document, printer and pages, and only the person at the keyboard can
choose Print: ui.dialog.confirm and synthetic input are refused. Cancel
drops the jobs. A failed or stopped run sends nothing, and no job is
sent if one of its printers is no longer installed. A run prepares at
most 4 jobs, 100 pages and 32 MiB, and pages are counted before a job
is composed. The web, MCP and the command line cannot print to a
printer from a script.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-21 20:51:08 -08:00
dotCooCoo 1b429b586e Scripts: Document.print prints to a file with PrintOptions and its option classes
Document.print(options) writes the file jobOptions.file names, checked as
saveAs checks its file: PostScript when the name ends with .ps or
postScriptLevel is assigned, a print-ready PDF otherwise. Only the
properties a script assigns are sent to file.print over the document's
saved print settings, which stay as they are, and no undo step is added.
Without a file it throws, since printing to a printer is not available
to scripts yet.

- new PrintOptions() and its nine option classes read as their help
  pages' defaults until assigned, and a PrintOptions holds its option
  objects by reference. Each value is checked when it is assigned.
- Preset, profile and paper names must name an existing preset, an RGB
  or CMYK profile or a known paper; an empty name or one holding a path
  separator or control character throws. An artboardRange naming a
  missing artboard throws before anything is written.
- Options and values that are not mapped throw an error that says they
  are not available yet. printerName and PPDName take only "".
- app.printPresetsList lists the print presets, app.PPDFileList is
  empty, and the print enumerations are published.
- Each warning file.print gives goes to the Script Console.
- vc.run still cannot run file.print or print.*.
- A hosted File given to or returned by a member stays a File.

Help pages: https://ai-scripting.docsforadobe.dev/jsobjref/PrintOptions/
and the option class pages beside it.
2026-11-21 18:31:30 -08:00