From 6eb973f8dd6064b65d20aa77bbb9b4c292c1acde Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 00:01:47 -0800 Subject: [PATCH] Export for Screens: Include Bleed keeps a PDF page's TrimBox at the artboard With Include Bleed, every artboard was grown by the document's bleed and PDF rows were written from the grown artboard. A row that used the document's bleed then put the bleed around it a second time: a 100 pt artboard with a 9 pt bleed wrote a 118 pt TrimBox in a 136 pt BleedBox, and printer's marks lined up with the bleed edge instead of the trim. PDF rows now write the artboards as they are, with the row's bleed around each one once (PDF 32000-1:2008, 14.11.2: the TrimBox is the finished page and the BleedBox holds it). The bleed is the row's own values, zero included, else the document's bleed when the row sets none and its PDF preset gives none or a bleed of 0. That gives a 100 pt TrimBox in a 118 pt BleedBox for one file per artboard, a single file and the Full Document. Raster, SVG, EPS, AI and native rows still write the grown artboard. A PDF/X row that sets a bleed of 0 itself warns again that it leaves the document's bleed out. A row without a bleed and a row that asks for the document's bleed write one file. --- crates/engine/src/cmd/fileio/commands.rs | 2 +- crates/engine/src/cmd/fileio/screens.rs | 73 ++++++++++++----- crates/engine/src/cmd/fileio/tests_screens.rs | 80 ++++++++++++++++++- docs/mcp.md | 4 +- docs/target-app-parity.md | 1 + 5 files changed, 139 insertions(+), 21 deletions(-) diff --git a/crates/engine/src/cmd/fileio/commands.rs b/crates/engine/src/cmd/fileio/commands.rs index ca4a2b1c83..5ee469d71b 100644 --- a/crates/engine/src/cmd/fileio/commands.rs +++ b/crates/engine/src/cmd/fileio/commands.rs @@ -54,7 +54,7 @@ pub fn specs() -> Vec { "Export for Screens", ["File", "Export"], None, - "{folder?, zip?: false (one .zip of every file, each deflated or stored, whichever is smaller: no folder → {name, dataBase64, bytes, files: [name…]}; with a folder it is written there → {path, bytes, files}), artboard?: index | artboards?: [index…] | range?: \"1-3\" (default all), assets?: [asset id…] (instead of artboards: each asset's art alone, cropped to its bounds and named after the asset; see assets.list), layers?: [layer id…] (instead of artboards: each layer's art alone, sublayers included, named after the layer), selection?: one|each (instead of artboards: the selected art as one file, or a file per selected object, named after it), fullDocument?: false (one file per format instead: a PDF of every artboard, other formats the bounds of all visible art, named after the document), includeBleed?: false (artboards grown by the document's bleed), includeArtboardFill?: true (Include Artboard Fill: each artboard's background color behind its art; false leaves it out), pdfs?: multiple|single (Export PDFs As: with several artboards, single writes them as the pages of one PDF per PDF row, named after the document), exportPreset?: (a preset of document.exportPresets.list: its settings, under these params), subfolders?: false (each row's files in a sub-folder: its folder, else its size for raster (1x, 2x, 100w…) or its format (SVG, PDF)), folders?: none|rows (as subfolders)|format (a folder per extension: png, svg, pdf…)|item (a folder per artboard, asset, layer or object)|itemFormat (item/extension) (default: rows with subfolders or a preset, else none), name?: (a file name pattern instead of the item's name, with for the document, for the artboard, asset, layer or object, from 1, #### for the counter zero-padded to the run of #, , , (else the row's suffix ends the name), YYYYMMDD, YYYY-MM-DD, YYYY, ,