pub struct PolygonAnnotation {Show 13 fields
pub vertices: Vec<(f64, f64)>,
pub polygon_type: PolygonType,
pub line_endings: Option<(LineEndingStyle, LineEndingStyle)>,
pub color: Option<AnnotationColor>,
pub interior_color: Option<AnnotationColor>,
pub opacity: Option<f32>,
pub border_style: Option<BorderStyleType>,
pub border_width: Option<f32>,
pub border_effect: Option<BorderEffect>,
pub contents: Option<String>,
pub author: Option<String>,
pub subject: Option<String>,
pub flags: AnnotationFlags,
}Expand description
A Polygon or PolyLine annotation per PDF spec Section 12.5.6.9.
Fields§
§vertices: Vec<(f64, f64)>Vertices as (x, y) coordinate pairs
polygon_type: PolygonTypeWhether this is a closed polygon or open polyline
line_endings: Option<(LineEndingStyle, LineEndingStyle)>Line endings for PolyLine (start, end)
color: Option<AnnotationColor>Stroke color
interior_color: Option<AnnotationColor>Interior (fill) color (for Polygon)
opacity: Option<f32>Opacity
border_style: Option<BorderStyleType>Border style
border_width: Option<f32>Border width
border_effect: Option<BorderEffect>Border effect
contents: Option<String>Contents/comment
Author
subject: Option<String>Subject
flags: AnnotationFlagsAnnotation flags
Implementations§
Source§impl PolygonAnnotation
impl PolygonAnnotation
Sourcepub fn with_line_endings(
self,
start: LineEndingStyle,
end: LineEndingStyle,
) -> Self
pub fn with_line_endings( self, start: LineEndingStyle, end: LineEndingStyle, ) -> Self
Set line endings (for PolyLine only).
Sourcepub fn with_stroke_color(self, r: f32, g: f32, b: f32) -> Self
pub fn with_stroke_color(self, r: f32, g: f32, b: f32) -> Self
Set stroke color (RGB).
Sourcepub fn with_fill_color(self, r: f32, g: f32, b: f32) -> Self
pub fn with_fill_color(self, r: f32, g: f32, b: f32) -> Self
Set fill color (RGB).
Sourcepub fn with_no_fill(self) -> Self
pub fn with_no_fill(self) -> Self
Set no fill.
Sourcepub fn with_border_width(self, width: f32) -> Self
pub fn with_border_width(self, width: f32) -> Self
Set border width.
Sourcepub fn with_border_style(self, style: BorderStyleType) -> Self
pub fn with_border_style(self, style: BorderStyleType) -> Self
Set border style.
Sourcepub fn with_border_effect(self, effect: BorderEffect) -> Self
pub fn with_border_effect(self, effect: BorderEffect) -> Self
Set border effect.
Sourcepub fn with_opacity(self, opacity: f32) -> Self
pub fn with_opacity(self, opacity: f32) -> Self
Set opacity.
Sourcepub fn with_contents(self, contents: impl Into<String>) -> Self
pub fn with_contents(self, contents: impl Into<String>) -> Self
Set contents/comment.
Set author.
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_flags(self, flags: AnnotationFlags) -> Self
pub fn with_flags(self, flags: AnnotationFlags) -> Self
Set annotation flags.
Sourcepub fn calculate_rect(&self) -> Rect
pub fn calculate_rect(&self) -> Rect
Calculate bounding rectangle from vertices.
Trait Implementations§
Source§impl Clone for PolygonAnnotation
impl Clone for PolygonAnnotation
Source§fn clone(&self) -> PolygonAnnotation
fn clone(&self) -> PolygonAnnotation
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 moreSource§impl Debug for PolygonAnnotation
impl Debug for PolygonAnnotation
Source§impl From<PolygonAnnotation> for Annotation
impl From<PolygonAnnotation> for Annotation
Source§fn from(polygon: PolygonAnnotation) -> Self
fn from(polygon: PolygonAnnotation) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PolygonAnnotation
impl RefUnwindSafe for PolygonAnnotation
impl Send for PolygonAnnotation
impl Sync for PolygonAnnotation
impl Unpin for PolygonAnnotation
impl UnsafeUnpin for PolygonAnnotation
impl UnwindSafe for PolygonAnnotation
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> 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