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
Error::PageIndexOutOfRangewhenpageis outside the document.Error::InlinePagewhen the page has no object of its own.Error::EmptyQuadPointswhen a text-markup annot has no quads.