Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Docs: scope placed-PDF layer choices to the placements the export walks reach

skylar taylor-barrick15963c69b150
diff --git a/docs/gaps.md b/docs/gaps.md
index 50d6724bb..b41fc3217 100644
--- a/docs/gaps.md
+++ b/docs/gaps.md
@@ -211,7 +211,9 @@ Kind: **F** feature · **U** UI/UX · **T** typography · **FF** file format ·
references, redefining the existing catalog rather than choosing an arbitrary object number.
Encrypted, hybrid-reference and over-budget rewrites are rejected; no print-fidelity claim.
- **Layer choices:** placed PDFs distinguish explicit all-on visibility from file defaults;
- choices survive native saves, raster/PDF output and embedded IDML export. IDML layer
+ choices survive native saves, raster/PDF output and embedded IDML export for the placements the
+ export walks reach: document and parent spreads, groups, and objects anchored in a story. A
+ placement anchored inside table-cell or footnote/endnote text is not reached yet. IDML layer
variants are embedded copies; external-only export is rejected when choices would be lost.
- **Missing:** EPS is shown through its preview only (no PostScript interpreter); PSD layer
comps beyond visibility; the Clipping Path Options dialog (tracing into a clip that keeps the
diff --git a/docs/pdf-layer-visibility.md b/docs/pdf-layer-visibility.md
index df670a6fa..101adafff 100644
--- a/docs/pdf-layer-visibility.md
+++ b/docs/pdf-layer-visibility.md
@@ -4,6 +4,6 @@ Object Layer Options distinguishes a PDF's own default configuration from an exp
The engine command `object.layerOptions` accepts `hidden` names and optional `useDefaults`. Existing calls with `hidden: []` retain their reset behavior; pass `useDefaults: false` to explicitly show all layers. `useDefaults: true` resets defaults and cannot be combined with hidden names. Every explicit choice, including all-on (`useDefaults: false` with an empty `hidden` list), is checked with one actual visibility rewrite per distinct source before any target is edited or an undo step is recorded: a PDF can list readable layers yet refuse the rewrite (for example an over-budget cross-reference history), and PDFs without readable optional-content layers cannot be rewritten at all. Resetting to file defaults needs no rewrite and is always allowed. A stored choice whose source can no longer be rewritten still fails closed: the canvas does not draw the unmodified source and PDF export reports an error. With no explicit ID, a query selects the first placed PDF anywhere in the selection; an explicit non-PDF ID remains an error. Queries include `overridden` separately from each layer's `visible` and `default` states.
-Native saves use format 4 only for an explicit all-on override, on document or parent spreads, in groups or anchored: older readers would otherwise silently render file defaults. Format 4 is one reader capability shared with retained placed-graphic layer options (#1647, see [graphic-layer-options.md](graphic-layer-options.md)), so a version 4 reader understands both. Existing nonempty hidden lists retain their older semantics and format requirements. Raster and PDF export honor the choice; PDF export keeps its existing warned rasterization behavior. Embedded IDML export stores a separate PDF variant per placement and leaves original linked bytes untouched. Every placement counts there: parent-page and anchored ones too, so a page that inherits the placement does not quietly fall back to the file's defaults. External-only IDML export rejects active PDF layer choices because the original external file would lose the choice. A package's IDML copy links the placed files, so it cannot carry a choice either; the package report says so, and the packaged DesignCraft document keeps it.
+Native saves use format 4 only for an explicit all-on override, on document or parent spreads, in groups or anchored: older readers would otherwise silently render file defaults. Format 4 is one reader capability shared with retained placed-graphic layer options (#1647, see [graphic-layer-options.md](graphic-layer-options.md)), so a version 4 reader understands both. Existing nonempty hidden lists retain their older semantics and format requirements. Raster and PDF export honor the choice; PDF export keeps its existing warned rasterization behavior. Embedded IDML export stores a separate PDF variant per placement and leaves original linked bytes untouched. The export walks cover the placements a page shows through its spreads and through its stories: parent-page and anchored ones too, so a page that inherits the placement does not quietly fall back to the file's defaults. They do not follow the stories nested in table cells or in footnotes and endnotes yet, so a placement anchored there keeps its choice on the document while the IDML copy is left at the file's defaults and the PDF/A-2b rasterisation pass does not flatten it; widening that traversal is separate work (gap 19). External-only IDML export rejects active PDF layer choices because the original external file would lose the choice. A package's IDML copy links the placed files, so it cannot carry a choice either; the package report says so, and the packaged DesignCraft document keeps it.
This fixes visibility-state handling, not full InDesign layer/print parity. It does not implement editing the contents of placed PDFs or native INDD placement. Catalog/reference safety fixes landed in #1670.