pub enum PdfPageAnnotation<'a> {
Show 13 variants Circle(PdfPageCircleAnnotation<'a>), FreeText(PdfPageFreeTextAnnotation<'a>), Highlight(PdfPageHighlightAnnotation<'a>), Ink(PdfPageInkAnnotation<'a>), Link(PdfPageLinkAnnotation<'a>), Popup(PdfPagePopupAnnotation<'a>), Square(PdfPageSquareAnnotation<'a>), Squiggly(PdfPageSquigglyAnnotation<'a>), Stamp(PdfPageStampAnnotation<'a>), Strikeout(PdfPageStrikeoutAnnotation<'a>), Text(PdfPageTextAnnotation<'a>), Underline(PdfPageUnderlineAnnotation<'a>), Unsupported(PdfPageUnsupportedAnnotation<'a>),
}
Expand description

A single user annotation on a PdfPage.

Variants§

§

Circle(PdfPageCircleAnnotation<'a>)

§

FreeText(PdfPageFreeTextAnnotation<'a>)

§

Highlight(PdfPageHighlightAnnotation<'a>)

§

Ink(PdfPageInkAnnotation<'a>)

§

Popup(PdfPagePopupAnnotation<'a>)

§

Square(PdfPageSquareAnnotation<'a>)

§

Squiggly(PdfPageSquigglyAnnotation<'a>)

§

Stamp(PdfPageStampAnnotation<'a>)

§

Strikeout(PdfPageStrikeoutAnnotation<'a>)

§

Text(PdfPageTextAnnotation<'a>)

§

Underline(PdfPageUnderlineAnnotation<'a>)

§

Unsupported(PdfPageUnsupportedAnnotation<'a>)

Common properties shared by all PdfPageAnnotation types can still be accessed for annotations not supported by Pdfium, but annotation-specific functionality will be unavailable.

Implementations§

source§

impl<'a> PdfPageAnnotation<'a>

source

pub fn annotation_type(&self) -> PdfPageAnnotationType

The type of this PdfPageAnnotation.

Not all PDF annotation types are supported by Pdfium. For example, Pdfium does not currently support embedded sound or movie files, embedded 3D animations, or embedded file attachments generally.

Pdfium currently supports creating, editing, and rendering the following types of annotations:

source

pub fn is_supported(&self) -> bool

Returns true if Pdfium supports creating, editing, and rendering this type of PdfPageAnnotation.

Not all PDF annotation types are supported by Pdfium. For example, Pdfium does not currently support embedded sound or movie files, embedded 3D animations, or embedded file attachments generally.

Pdfium currently supports creating, editing, and rendering the following types of annotations:

source

pub fn is_unsupported(&self) -> bool

Returns true if Pdfium does not support creating, editing, and rendering this type of PdfPageAnnotation.

Not all PDF annotation types are supported by Pdfium. For example, Pdfium does not currently support embedded sound or movie files, embedded 3D animations, or embedded file attachments generally.

Pdfium currently supports creating, editing, and rendering the following types of annotations:

source

pub fn as_circle_annotation(&self) -> Option<&PdfPageCircleAnnotation<'_>>

Returns the underlying PdfPageCircleAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Circle.

source

pub fn as_free_text_annotation(&self) -> Option<&PdfPageFreeTextAnnotation<'_>>

Returns the underlying PdfPageFreeTextAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::FreeText.

source

pub fn as_highlight_annotation(&self) -> Option<&PdfPageHighlightAnnotation<'_>>

Returns the underlying PdfPageHighlightAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Highlight.

source

pub fn as_ink_annotation(&self) -> Option<&PdfPageInkAnnotation<'_>>

Returns the underlying PdfPageInkAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Ink.

Returns the underlying PdfPageLinkAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Link.

source

pub fn as_popup_annotation(&self) -> Option<&PdfPagePopupAnnotation<'_>>

Returns the underlying PdfPagePopupAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Popup.

source

pub fn as_square_annotation(&self) -> Option<&PdfPageSquareAnnotation<'_>>

Returns the underlying PdfPageSquareAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Square.

source

pub fn as_squiggly_annotation(&self) -> Option<&PdfPageSquigglyAnnotation<'_>>

Returns the underlying PdfPageSquigglyAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Squiggly.

source

pub fn as_stamp_annotation(&self) -> Option<&PdfPageStampAnnotation<'_>>

Returns the underlying PdfPageStampAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Stamp.

source

pub fn as_strikeout_annotation(&self) -> Option<&PdfPageStrikeoutAnnotation<'_>>

Returns the underlying PdfPageStrikeoutAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Strikeout.

source

pub fn as_text_annotation(&self) -> Option<&PdfPageTextAnnotation<'_>>

Returns the underlying PdfPageTextAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Text.

source

pub fn as_underline_annotation(&self) -> Option<&PdfPageUnderlineAnnotation<'_>>

Returns the underlying PdfPageUnderlineAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Underline.

Trait Implementations§

source§

impl<'a> Drop for PdfPageAnnotation<'a>

source§

fn drop(&mut self)

Closes this PdfPageAnnotation, releasing held memory.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for PdfPageAnnotation<'a>

§

impl<'a> !Send for PdfPageAnnotation<'a>

§

impl<'a> !Sync for PdfPageAnnotation<'a>

§

impl<'a> Unpin for PdfPageAnnotation<'a>

§

impl<'a> !UnwindSafe for PdfPageAnnotation<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<'a, T> PdfPageAnnotationCommon for Twhere T: PdfPageAnnotationPrivate<'a>,

source§

fn name(&self) -> Option<String>

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.
source§

fn bounds(&self) -> Result<PdfRect, PdfiumError>

Returns the bounding box of this PdfPageAnnotation.
source§

fn contents(&self) -> Option<String>

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.
source§

fn creator(&self) -> Option<String>

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

fn creation_date(&self) -> Option<String>

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

fn modification_date(&self) -> Option<String>

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

fn objects(&self) -> &PdfPageAnnotationObjects<'_>

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

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.