pub struct Annotation {
pub annotation_type: AnnotationType,
pub rect: Rectangle,
pub contents: Option<String>,
pub subject: Option<String>,
pub name: Option<String>,
pub modified: Option<String>,
pub flags: AnnotationFlags,
pub border: Option<BorderStyle>,
pub color: Option<Color>,
pub page: Option<ObjectReference>,
pub properties: Dictionary,
}Expand description
Base annotation structure
Fields§
§annotation_type: AnnotationTypeAnnotation type
rect: RectangleRectangle defining annotation position
contents: Option<String>Optional content text
subject: Option<String>Optional subject
name: Option<String>Optional annotation name
modified: Option<String>Modification date
flags: AnnotationFlagsFlags
border: Option<BorderStyle>Border style
color: Option<Color>Color
page: Option<ObjectReference>Page reference (set by manager)
properties: DictionaryAdditional properties specific to annotation type
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn new(annotation_type: AnnotationType, rect: Rectangle) -> Self
pub fn new(annotation_type: AnnotationType, rect: Rectangle) -> Self
Create a new annotation
Sourcepub fn with_contents(self, contents: impl Into<String>) -> Self
pub fn with_contents(self, contents: impl Into<String>) -> Self
Set contents
Sourcepub fn with_subject(self, subject: impl Into<String>) -> Self
pub fn with_subject(self, subject: impl Into<String>) -> Self
Set subject
Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Set color
Sourcepub fn with_border(self, border: BorderStyle) -> Self
pub fn with_border(self, border: BorderStyle) -> Self
Set border
Sourcepub fn with_flags(self, flags: AnnotationFlags) -> Self
pub fn with_flags(self, flags: AnnotationFlags) -> Self
Set flags
Sourcepub fn set_field_dict(&mut self, field_dict: Dictionary)
pub fn set_field_dict(&mut self, field_dict: Dictionary)
Set field dictionary properties (for widget annotations)
Sourcepub fn to_dict(&self) -> Dictionary
pub fn to_dict(&self) -> Dictionary
Convert to PDF dictionary
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnwindSafe for Annotation
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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