mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-29 12:38:58 -06:00
The print-ready PDF that `pdfcraft_print::impose` builds starts from a new catalog with only /Type and /Pages, so the document's /OCProperties was not carried over. The pages' marked content still refers to its optional-content groups, but nothing said a group was off, so a layer that is switched off in the document (and not drawn on screen) was printed anyway. Keep /OCProperties in the new catalog, so the sheets hide the same layers the document hides. Test: a one-page document whose red square is in a layer; with the layer off by default it is not drawn on screen and, now, not on the printed sheet; with the layer on it is drawn in both. Printing still follows the layers' default state only; applying the Print event of /AS (a layer shown only on screen or only in print) is not done here.