Skip to main content

add_annotation

Function add_annotation 

Source
pub fn add_annotation(
    edit: &mut EditDoc<'_>,
    page: impl Into<PageIndex>,
    write: impl Into<AnnotWrite>,
) -> Result<ObjRef, Error>
Expand description

Adds an annotation described by spec to page, returning the new annotation’s object reference.

The annotation is written as a new indirect object (/Type /Annot, /Subtype, /Rect, /C, /F — Print by default, or AnnotMeta::flags) and appended to the page’s /Annots: a missing array is created; an indirect array is extended in place; an inline array is rewritten on the page. /P is set to the page object.

§Errors