PdfPageAnnotations

Struct PdfPageAnnotations 

Source
pub struct PdfPageAnnotations<'a> { /* private fields */ }
Expand description

The annotations that have been added to a single PdfPage.

Implementations§

Source§

impl<'a> PdfPageAnnotations<'a>

Source

pub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings

Returns the PdfiumLibraryBindings used by this PdfPageAnnotations collection.

Source

pub fn len(&self) -> PdfPageAnnotationIndex

Returns the total number of annotations that have been added to the containing PdfPage.

Source

pub fn is_empty(&self) -> bool

Returns true if this PdfPageAnnotations collection is empty.

Source

pub fn as_range(&self) -> Range<PdfPageAnnotationIndex>

Returns a Range from 0..(number of annotations) for this PdfPageAnnotations collection.

Source

pub fn get( &self, index: PdfPageAnnotationIndex, ) -> Result<PdfPageAnnotation<'a>, PdfiumError>

Returns a single PdfPageAnnotation from this PdfPageAnnotations collection.

Source

pub fn first(&self) -> Result<PdfPageAnnotation<'a>, PdfiumError>

Returns the first PdfPageAnnotation in this PdfPageAnnotations collection.

Source

pub fn last(&self) -> Result<PdfPageAnnotation<'a>, PdfiumError>

Returns the last PdfPageAnnotation in this PdfPageAnnotations collection.

Source

pub fn iter(&self) -> PdfPageAnnotationsIterator<'_>

Returns an iterator over all the annotations in this PdfPageAnnotations collection.

Source

pub fn create_free_text_annotation( &mut self, text: &str, ) -> Result<PdfPageFreeTextAnnotation<'a>, PdfiumError>

Creates a new PdfPageFreeTextAnnotation containing the given text in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_highlight_annotation( &mut self, ) -> Result<PdfPageHighlightAnnotation<'a>, PdfiumError>

Creates a new PdfPageHighlightAnnotation annotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_ink_annotation( &mut self, ) -> Result<PdfPageInkAnnotation<'a>, PdfiumError>

Creates a new PdfPageInkAnnotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Creates a new PdfPageLinkAnnotation with the given URI in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_popup_annotation( &mut self, ) -> Result<PdfPagePopupAnnotation<'a>, PdfiumError>

Creates a new PdfPagePopupAnnotation annotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_square_annotation( &mut self, ) -> Result<PdfPageSquareAnnotation<'a>, PdfiumError>

Creates a new PdfPageSquareAnnotation annotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_squiggly_annotation( &mut self, ) -> Result<PdfPageSquigglyAnnotation<'a>, PdfiumError>

Creates a new PdfPageSquigglyAnnotation annotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_stamp_annotation( &mut self, ) -> Result<PdfPageStampAnnotation<'a>, PdfiumError>

Creates a new PdfPageStampAnnotation annotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_strikeout_annotation( &mut self, ) -> Result<PdfPageStrikeoutAnnotation<'a>, PdfiumError>

Creates a new PdfPageStrikeoutAnnotation annotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_text_annotation( &mut self, text: &str, ) -> Result<PdfPageTextAnnotation<'a>, PdfiumError>

Creates a new PdfPageTextAnnotation containing the given text in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_underline_annotation( &mut self, ) -> Result<PdfPageUnderlineAnnotation<'a>, PdfiumError>

Creates a new PdfPageUnderlineAnnotation annotation in this PdfPageAnnotations collection, returning the newly created annotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_squiggly_annotation_under_object( &mut self, object: &PdfPageObject<'_>, color: PdfColor, contents: Option<&str>, ) -> Result<PdfPageSquigglyAnnotation<'a>, PdfiumError>

Creates a new PdfPageSquigglyAnnotation annotation and positions it underneath the given PdfPageObject, coloring it with the given PdfColor.

If the given contents string is supplied, the annotation will be additionally configured so that when the given PdfPageObject is clicked in a conforming PDF viewer, the given contents string will be displayed in a popup window.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_underline_annotation_under_object( &mut self, object: &PdfPageObject<'_>, color: PdfColor, contents: Option<&str>, ) -> Result<PdfPageUnderlineAnnotation<'a>, PdfiumError>

Creates a new PdfPageUnderlineAnnotation annotation and positions it underneath the given PdfPageObject, coloring it with the given PdfColor.

If the given contents string is supplied, the annotation will be additionally configured so that when the given PdfPageObject is clicked in a conforming PDF viewer, the given contents string will be displayed in a popup window.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_strikeout_annotation_through_object( &mut self, object: &PdfPageObject<'_>, color: PdfColor, contents: Option<&str>, ) -> Result<PdfPageStrikeoutAnnotation<'a>, PdfiumError>

Creates a new PdfPageStrikeoutAnnotation annotation and vertically positions it in the center the given PdfPageObject, coloring it with the given PdfColor.

If the given contents string is supplied, the annotation will be additionally configured so that when the given PdfPageObject is clicked in a conforming PDF viewer, the given contents string will be displayed in a popup window.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn create_highlight_annotation_over_object( &mut self, object: &PdfPageObject<'_>, color: PdfColor, contents: Option<&str>, ) -> Result<PdfPageHighlightAnnotation<'a>, PdfiumError>

Creates a new PdfPageHighlightAnnotation annotation and positions it so as to cover the given PdfPageObject, coloring it with the given PdfColor.

If the given contents string is supplied, the annotation will be additionally configured so that when the given PdfPageObject is clicked in a conforming PDF viewer, the given contents string will be displayed in a popup window.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Source

pub fn delete_annotation( &mut self, annotation: PdfPageAnnotation<'a>, ) -> Result<(), PdfiumError>

Removes the given PdfPageAnnotation from this PdfPageAnnotations collection, consuming the PdfPageAnnotation.

If the containing PdfPage has a content regeneration strategy of PdfPageContentRegenerationStrategy::AutomaticOnEveryChange then content regeneration will be triggered on the page.

Auto Trait Implementations§

§

impl<'a> Freeze for PdfPageAnnotations<'a>

§

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

§

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

§

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

§

impl<'a> Unpin for PdfPageAnnotations<'a>

§

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

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.