#[non_exhaustive]pub struct AnnotBorder {
pub width: f32,
pub style: AnnotBorderStyle,
pub dash: Option<[i64; 3]>,
}Expand description
Width and style for an annotation /BS dictionary.
Defaults match what Square and Ink wrote previously: width 2, solid.
use pdfrum_edit::{AnnotBorder, AnnotBorderStyle};
let border = AnnotBorder::default();
assert_eq!(border.width, 2.0);
assert_eq!(border.style, AnnotBorderStyle::Solid);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.width: f32Border width (/W) in points.
style: AnnotBorderStyleBorder style (/S).
dash: Option<[i64; 3]>Dash pattern /D as [on gap phase], for a AnnotBorderStyle::Dash
border.
None writes no /D, and a reader then falls back to its own default
of [3 0 0] — so a dashed border without this is dashed, just not to a
pattern the file states. The key is written only for a dashed style,
since it means nothing to the others.
Implementations§
Source§impl AnnotBorder
impl AnnotBorder
Sourcepub fn solid(width: f32) -> Self
pub fn solid(width: f32) -> Self
A solid border of the given width.
use pdfrum_edit::{AnnotBorder, AnnotBorderStyle};
let border = AnnotBorder::solid(1.5);
assert_eq!(border.width, 1.5);
assert_eq!(border.style, AnnotBorderStyle::Solid);Sourcepub fn with_style(self, style: AnnotBorderStyle) -> Self
pub fn with_style(self, style: AnnotBorderStyle) -> Self
Sets the style, keeping the current width.
Sourcepub fn with_dash(self, dash: [i64; 3]) -> Self
pub fn with_dash(self, dash: [i64; 3]) -> Self
Sets /D, the dash pattern, as [on gap phase].
Only a AnnotBorderStyle::Dash border writes it. The reader takes
the three entries as on-length, gap-length and phase, and an absent
/D as its own [3 0 0].
use pdfrum_edit::{AnnotBorder, AnnotBorderStyle};
let border = AnnotBorder::solid(1.0)
.with_style(AnnotBorderStyle::Dash)
.with_dash([4, 2, 0]);
assert_eq!(border.dash, Some([4, 2, 0]));Trait Implementations§
Source§impl Clone for AnnotBorder
impl Clone for AnnotBorder
impl Copy for AnnotBorder
Source§impl Debug for AnnotBorder
impl Debug for AnnotBorder
Source§impl Default for AnnotBorder
impl Default for AnnotBorder
Source§impl PartialEq for AnnotBorder
impl PartialEq for AnnotBorder
impl StructuralPartialEq for AnnotBorder
Auto Trait Implementations§
impl Freeze for AnnotBorder
impl RefUnwindSafe for AnnotBorder
impl Send for AnnotBorder
impl Sync for AnnotBorder
impl Unpin for AnnotBorder
impl UnsafeUnpin for AnnotBorder
impl UnwindSafe for AnnotBorder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.