pub struct LineAnnotation {Show 17 fields
pub start: (f64, f64),
pub end: (f64, f64),
pub line_endings: (LineEndingStyle, LineEndingStyle),
pub color: Option<AnnotationColor>,
pub interior_color: Option<AnnotationColor>,
pub opacity: Option<f32>,
pub border_style: Option<BorderStyleType>,
pub line_width: Option<f32>,
pub leader_line: Option<f64>,
pub leader_line_offset: Option<f64>,
pub leader_line_extension: Option<f64>,
pub caption: bool,
pub contents: Option<String>,
pub caption_position: CaptionPosition,
pub author: Option<String>,
pub subject: Option<String>,
pub flags: AnnotationFlags,
}Expand description
A Line annotation per PDF spec Section 12.5.6.7.
Displays a single straight line on the page.
Fields§
§start: (f64, f64)Start point (x, y)
end: (f64, f64)End point (x, y)
line_endings: (LineEndingStyle, LineEndingStyle)Line ending styles (start, end)
color: Option<AnnotationColor>Stroke color
interior_color: Option<AnnotationColor>Interior color (for filled line endings)
opacity: Option<f32>Opacity (0.0 = transparent, 1.0 = opaque)
border_style: Option<BorderStyleType>Border style type
line_width: Option<f32>Line width
leader_line: Option<f64>Leader line length (positive = extends from endpoints)
leader_line_offset: Option<f64>Leader line offset (distance from endpoints)
leader_line_extension: Option<f64>Leader line extension (beyond leader line)
caption: boolWhether to show caption
contents: Option<String>Caption content
caption_position: CaptionPositionCaption positioning (Inline or Top)
Author
subject: Option<String>Subject
flags: AnnotationFlagsAnnotation flags
Implementations§
Source§impl LineAnnotation
impl LineAnnotation
Sourcepub fn double_arrow(start: (f64, f64), end: (f64, f64)) -> Self
pub fn double_arrow(start: (f64, f64), end: (f64, f64)) -> Self
Create a double-headed arrow line.
Sourcepub fn dimension(start: (f64, f64), end: (f64, f64), leader_length: f64) -> Self
pub fn dimension(start: (f64, f64), end: (f64, f64), leader_length: f64) -> Self
Create a dimension line (with leader lines).
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.
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 interior color for filled line endings (RGB).
Sourcepub fn with_line_width(self, width: f32) -> Self
pub fn with_line_width(self, width: f32) -> Self
Set line 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_leader_line(self, length: f64) -> Self
pub fn with_leader_line(self, length: f64) -> Self
Set leader line length.
Sourcepub fn with_leader_offset(self, offset: f64) -> Self
pub fn with_leader_offset(self, offset: f64) -> Self
Set leader line offset.
Sourcepub fn with_caption(self, text: impl Into<String>) -> Self
pub fn with_caption(self, text: impl Into<String>) -> Self
Set caption text.
Sourcepub fn with_caption_position(self, position: CaptionPosition) -> Self
pub fn with_caption_position(self, position: CaptionPosition) -> Self
Set caption position.
Sourcepub fn with_opacity(self, opacity: f32) -> Self
pub fn with_opacity(self, opacity: f32) -> Self
Set opacity.
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.
Trait Implementations§
Source§impl Clone for LineAnnotation
impl Clone for LineAnnotation
Source§fn clone(&self) -> LineAnnotation
fn clone(&self) -> LineAnnotation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more