--- '@embedpdf/engine-core': minor --- A push button can hold an image, as Acrobat's image field does: `doc.forms.setButtonImage(field, image | null)` puts a PNG, a JPEG or a one-page PDF in every widget of the field, or takes it out. The image is one part of the button's look, which is drawn from the image, the caption and the layout. - **`layout` on a widget** (`WidgetLayout`): where a push button's widget shows its caption and its image (`/MK /TP`): `'caption'`, `'image'`, `'caption-below'`, `'caption-above'`, `'caption-right'`, `'caption-left'` or `'caption-over'`. All seven read from the file, and a placement (`create()`, `addWidget()`) and `updateWidget()` write any of them. Every other widget reads `null` and refuses one; a push button's widget always has one, so `null` is refused there. - **`hasImage` on a push button** (`PushButtonField`): whether one of its widgets has an icon (`/MK /I`), one `setButtonImage()` put in or another app made. - **`doc.forms.setButtonImage()`** is filling in: it takes `doc.forms.fill`, or `fields:fill` for the field's group (any signer's, for a field anyone fills in), and a field a signature locked refuses it with `ProtectedDocument`. A signing that names no lock locks a field anyone fills in once it holds an image, as it does one that holds text. It is one change with one undo step, the op `forms.setButtonImage` of `doc.apply` (`{ field, image }`), and emits `forms.updated`. Each widget shows the image as its `layout` says, which is left as it is. - **A place added later gets the image:** `addWidget()` on a push button that holds one gives the new widget the same image, as a text field's new widget shows its value. It shows it as the placement's `layout` says; without `layout: 'image'` the new place keeps the image and shows its caption. - **The image is stored once**, however many push buttons, signature fields and stamps show it. A copy with its values (`doc.forms.copy()`) keeps a push button's image, and a form bundle carries it as the widget's `image` resource, once. A field marked `noExport` exports without it (`hasImage: false`, no resource), as without its value. - **Signatures: an image is filling in.** `doc.signatures.analyze()` counts a push button's image as filling in, as Acrobat does: putting one in or taking it out (a change of `/MK /I` and nothing else in `/MK`, and the drawing under it) is `permitted` after an approval signature and after a certification that allows form filling. A field a signature locked stays `forbidden`, and so does a change to a button's caption, colors or layout under such a certification. - **Reading an older side:** a field or a bundle without `hasImage` reads `false`, and a widget row without `layout` reads `'caption'` for a push button's and `null` for any other (`WidgetDTOSchema`, `FormFieldDTOSchema`, `completeFormBundle()`). `BUTTON_IMAGE_AND_LAYOUT_SINCE` (`'3.5'`) is the version both arrive in on the wire, and `forms.setButtonImage` is a change kind of that version. On the wire the op names its image's part as `resources: { image }` (`ButtonImageResourceKeysSchema`).