pub struct TextSpec { /* private fields */ }Expand description
A sticky-note text annotation (/Subtype /Text).
use kurbo::Rect;
use peniko::Color;
use pdfrum_edit::{AnnotSpec, TextSpec};
let spec: AnnotSpec = TextSpec::new(Rect::new(0.0, 0.0, 20.0, 20.0), Color::from_rgb8(255, 255, 0))
.icon("Note")
.open(true)
.into();Implementations§
Source§impl TextSpec
impl TextSpec
Sourcepub fn contents(self, contents: impl Into<String>) -> Self
pub fn contents(self, contents: impl Into<String>) -> Self
A sticky-note annotation.
Sets /Contents.
A sticky-note annotation.
Sets /T, the author.
Sourcepub fn name(self, name: impl Into<String>) -> AnnotWrite
pub fn name(self, name: impl Into<String>) -> AnnotWrite
A sticky-note annotation.
Sets /NM, the annotation’s unique name.
Sourcepub fn modified(self, modified: impl Into<String>) -> AnnotWrite
pub fn modified(self, modified: impl Into<String>) -> AnnotWrite
A sticky-note annotation.
Sets /M, the modification date.
Sourcepub fn flags(self, flags: AnnotFlags) -> AnnotWrite
pub fn flags(self, flags: AnnotFlags) -> AnnotWrite
A sticky-note annotation.
Sets /F, the annotation flags.
Sourcepub fn meta(self, meta: AnnotMeta) -> AnnotWrite
pub fn meta(self, meta: AnnotMeta) -> AnnotWrite
A sticky-note annotation.
Sets every metadata field at once.
Trait Implementations§
Source§impl From<TextSpec> for AnnotWrite
impl From<TextSpec> for AnnotWrite
impl StructuralPartialEq for TextSpec
Auto Trait Implementations§
impl Freeze for TextSpec
impl RefUnwindSafe for TextSpec
impl Send for TextSpec
impl Sync for TextSpec
impl Unpin for TextSpec
impl UnsafeUnpin for TextSpec
impl UnwindSafe for TextSpec
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<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
Convert this type into
T, using the provided data to resolve any offsets.