pub trait PdfPageAnnotationCommon {
    fn name(&self) -> Option<String>;
    fn bounds(&self) -> Result<PdfRect, PdfiumError>;
    fn contents(&self) -> Option<String>;
    fn creator(&self) -> Option<String>;
    fn creation_date(&self) -> Option<String>;
    fn modification_date(&self) -> Option<String>;
    fn objects(&self) -> &PdfPageAnnotationObjects<'_>;
}
Expand description

Functionality common to all PdfPageAnnotation objects, regardless of their PdfPageAnnotationType.

Required Methods§

Returns the name of this PdfPageAnnotation, if any. This is a text string uniquely identifying this annotation among all the annotations attached to the containing page.

Returns the bounding box of this PdfPageAnnotation.

Returns the text to be displayed for this PdfPageAnnotation, or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form. In either case this text is useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes.

Returns the name of the creator of this PdfPageAnnotation, if any.

Returns the date and time when this PdfPageAnnotation was originally created, if any.

Returns the date and time when this PdfPageAnnotation was last modified, if any.

Returns an immutable collection of all the page objects in this PdfPageAnnotation.

Page objects can be retrieved from any type of PdfPageAnnotation, but Pdfium currently only permits adding new page objects to, or removing existing page objects from, annotations of types PdfPageAnnotationType::Ink and PdfPageAnnotationType::Stamp. All other annotation types are read-only.

To gain access to the mutable collection of page objects inside an ink or stamp annotation, you must first unwrap the annotation, like so:

annotation.as_stamp_annotation().unwrap().objects_mut();

Implementors§