pub enum PdfPageAnnotation<'a> {
Show 15 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>),
Widget(PdfPageWidgetAnnotation<'a>),
XfaWidget(PdfPageXfaWidgetAnnotation<'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>)
Link(PdfPageLinkAnnotation<'a>)
Popup(PdfPagePopupAnnotation<'a>)
Square(PdfPageSquareAnnotation<'a>)
Squiggly(PdfPageSquigglyAnnotation<'a>)
Stamp(PdfPageStampAnnotation<'a>)
Strikeout(PdfPageStrikeoutAnnotation<'a>)
Text(PdfPageTextAnnotation<'a>)
Underline(PdfPageUnderlineAnnotation<'a>)
Widget(PdfPageWidgetAnnotation<'a>)
XfaWidget(PdfPageXfaWidgetAnnotation<'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>
impl<'a> PdfPageAnnotation<'a>
sourcepub fn annotation_type(&self) -> PdfPageAnnotationType
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:
- PdfPageAnnotationType::Circle
- PdfPageAnnotationType::FreeText
- PdfPageAnnotationType::Highlight
- PdfPageAnnotationType::Ink
- PdfPageAnnotationType::Link
- PdfPageAnnotationType::Popup
- PdfPageAnnotationType::Square
- PdfPageAnnotationType::Squiggly
- PdfPageAnnotationType::Stamp
- PdfPageAnnotationType::Strikeout
- PdfPageAnnotationType::Text
- PdfPageAnnotationType::Underline
- PdfPageAnnotationType::Widget
- PdfPageAnnotationType::XfaWidget
sourcepub fn is_supported(&self) -> bool
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:
- PdfPageAnnotationType::Circle
- PdfPageAnnotationType::FreeText
- PdfPageAnnotationType::Highlight
- PdfPageAnnotationType::Ink
- PdfPageAnnotationType::Link
- PdfPageAnnotationType::Popup
- PdfPageAnnotationType::Square
- PdfPageAnnotationType::Squiggly
- PdfPageAnnotationType::Stamp
- PdfPageAnnotationType::Strikeout
- PdfPageAnnotationType::Text
- PdfPageAnnotationType::Underline
- PdfPageAnnotationType::Widget
- PdfPageAnnotationType::XfaWidget
sourcepub fn is_unsupported(&self) -> bool
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:
- PdfPageAnnotationType::Circle
- PdfPageAnnotationType::FreeText
- PdfPageAnnotationType::Highlight
- PdfPageAnnotationType::Ink
- PdfPageAnnotationType::Link
- PdfPageAnnotationType::Popup
- PdfPageAnnotationType::Square
- PdfPageAnnotationType::Squiggly
- PdfPageAnnotationType::Stamp
- PdfPageAnnotationType::Strikeout
- PdfPageAnnotationType::Text
- PdfPageAnnotationType::Underline
- PdfPageAnnotationType::Widget
- PdfPageAnnotationType::XfaWidget
sourcepub fn as_circle_annotation(&self) -> Option<&PdfPageCircleAnnotation<'_>>
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.
sourcepub fn as_free_text_annotation(&self) -> Option<&PdfPageFreeTextAnnotation<'_>>
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.
sourcepub fn as_highlight_annotation(&self) -> Option<&PdfPageHighlightAnnotation<'_>>
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.
sourcepub fn as_ink_annotation(&self) -> Option<&PdfPageInkAnnotation<'_>>
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.
sourcepub fn as_link_annotation(&self) -> Option<&PdfPageLinkAnnotation<'_>>
pub fn as_link_annotation(&self) -> Option<&PdfPageLinkAnnotation<'_>>
Returns the underlying PdfPageLinkAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Link.
sourcepub fn as_popup_annotation(&self) -> Option<&PdfPagePopupAnnotation<'_>>
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.
sourcepub fn as_square_annotation(&self) -> Option<&PdfPageSquareAnnotation<'_>>
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.
sourcepub fn as_squiggly_annotation(&self) -> Option<&PdfPageSquigglyAnnotation<'_>>
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.
sourcepub fn as_stamp_annotation(&self) -> Option<&PdfPageStampAnnotation<'_>>
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.
sourcepub fn as_strikeout_annotation(&self) -> Option<&PdfPageStrikeoutAnnotation<'_>>
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.
sourcepub fn as_text_annotation(&self) -> Option<&PdfPageTextAnnotation<'_>>
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.
sourcepub fn as_underline_annotation(&self) -> Option<&PdfPageUnderlineAnnotation<'_>>
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.
sourcepub fn as_widget_annotation(&self) -> Option<&PdfPageWidgetAnnotation<'_>>
pub fn as_widget_annotation(&self) -> Option<&PdfPageWidgetAnnotation<'_>>
Returns the underlying PdfPageWidgetAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::Widget.
sourcepub fn as_xfa_widget_annotation(
&self
) -> Option<&PdfPageXfaWidgetAnnotation<'_>>
pub fn as_xfa_widget_annotation( &self ) -> Option<&PdfPageXfaWidgetAnnotation<'_>>
Returns the underlying PdfPageXfaWidgetAnnotation for this PdfPageAnnotation, if this annotation has an annotation type of PdfPageAnnotationType::XfaWidget.
sourcepub fn as_form_field(&self) -> Option<&PdfFormField<'_>>
pub fn as_form_field(&self) -> Option<&PdfFormField<'_>>
Returns the PdfFormField wrapped by this PdfPageAnnotation, if any.
Only annotations of type PdfPageAnnotationType::Widget and PdfPageAnnotationType::XfaWidget wrap form fields.
Trait Implementations§
source§impl<'a> Drop for PdfPageAnnotation<'a>
impl<'a> Drop for PdfPageAnnotation<'a>
source§fn drop(&mut self)
fn drop(&mut self)
Closes this PdfPageAnnotation, releasing held memory.