Skip to main content

set_widget_appearance

Function set_widget_appearance 

Source
pub fn set_widget_appearance(
    dest: &mut EditDoc<'_>,
    annot: ObjRef,
    appearance: &WidgetAppearance,
) -> Result<(), Error>
Expand description

Sets a widget annotation’s /MK appearance characteristics.

annot is the widget’s own object — the reference an add_annotation returned, or one found by walking a page’s /Annots. Characteristics the builder leaves unset keep whatever the widget already had.

The generated appearance follows automatically: /BG and /BC are read every time a widget’s appearance is rebuilt, so this needs no companion call to redraw. A widget whose /AP is stale and which the document does not mark with set_need_appearances may still show its old face in a reader that trusts the stream, which is the ordinary appearance-staleness question rather than anything specific to /MK.

§Errors

Error::UnresolvedRef when annot names no dictionary.