pub struct PdfPageAnnotations<'a> { /* private fields */ }Expand description
The annotations that have been added to a single PdfPage.
Implementations§
Source§impl<'a> PdfPageAnnotations<'a>
impl<'a> PdfPageAnnotations<'a>
Sourcepub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
pub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
Returns the PdfiumLibraryBindings used by this PdfPageAnnotations collection.
Sourcepub fn len(&self) -> PdfPageAnnotationIndex
pub fn len(&self) -> PdfPageAnnotationIndex
Returns the total number of annotations that have been added to the containing PdfPage.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if this PdfPageAnnotations collection is empty.
Sourcepub fn as_range(&self) -> Range<PdfPageAnnotationIndex>
pub fn as_range(&self) -> Range<PdfPageAnnotationIndex>
Returns a Range from 0..(number of annotations) for this PdfPageAnnotations collection.
Sourcepub fn get(
&self,
index: PdfPageAnnotationIndex,
) -> Result<PdfPageAnnotation<'a>, PdfiumError>
pub fn get( &self, index: PdfPageAnnotationIndex, ) -> Result<PdfPageAnnotation<'a>, PdfiumError>
Returns a single PdfPageAnnotation from this PdfPageAnnotations collection.
Sourcepub fn first(&self) -> Result<PdfPageAnnotation<'a>, PdfiumError>
pub fn first(&self) -> Result<PdfPageAnnotation<'a>, PdfiumError>
Returns the first PdfPageAnnotation in this PdfPageAnnotations collection.
Sourcepub fn last(&self) -> Result<PdfPageAnnotation<'a>, PdfiumError>
pub fn last(&self) -> Result<PdfPageAnnotation<'a>, PdfiumError>
Returns the last PdfPageAnnotation in this PdfPageAnnotations collection.
Sourcepub fn iter(&self) -> PdfPageAnnotationsIterator<'_> ⓘ
pub fn iter(&self) -> PdfPageAnnotationsIterator<'_> ⓘ
Returns an iterator over all the annotations in this PdfPageAnnotations collection.
Sourcepub fn create_free_text_annotation(
&mut self,
text: &str,
) -> Result<PdfPageFreeTextAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_highlight_annotation(
&mut self,
) -> Result<PdfPageHighlightAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_ink_annotation(
&mut self,
) -> Result<PdfPageInkAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_link_annotation(
&mut self,
uri: &str,
) -> Result<PdfPageLinkAnnotation<'a>, PdfiumError>
pub fn create_link_annotation( &mut self, uri: &str, ) -> Result<PdfPageLinkAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_popup_annotation(
&mut self,
) -> Result<PdfPagePopupAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_square_annotation(
&mut self,
) -> Result<PdfPageSquareAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_squiggly_annotation(
&mut self,
) -> Result<PdfPageSquigglyAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_stamp_annotation(
&mut self,
) -> Result<PdfPageStampAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_strikeout_annotation(
&mut self,
) -> Result<PdfPageStrikeoutAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_text_annotation(
&mut self,
text: &str,
) -> Result<PdfPageTextAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_underline_annotation(
&mut self,
) -> Result<PdfPageUnderlineAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_squiggly_annotation_under_object(
&mut self,
object: &PdfPageObject<'_>,
color: PdfColor,
contents: Option<&str>,
) -> Result<PdfPageSquigglyAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_underline_annotation_under_object(
&mut self,
object: &PdfPageObject<'_>,
color: PdfColor,
contents: Option<&str>,
) -> Result<PdfPageUnderlineAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_strikeout_annotation_through_object(
&mut self,
object: &PdfPageObject<'_>,
color: PdfColor,
contents: Option<&str>,
) -> Result<PdfPageStrikeoutAnnotation<'a>, PdfiumError>
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.
Sourcepub fn create_highlight_annotation_over_object(
&mut self,
object: &PdfPageObject<'_>,
color: PdfColor,
contents: Option<&str>,
) -> Result<PdfPageHighlightAnnotation<'a>, PdfiumError>
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.
Sourcepub fn delete_annotation(
&mut self,
annotation: PdfPageAnnotation<'a>,
) -> Result<(), PdfiumError>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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