pub struct AnnotMeta {
pub author: Option<String>,
pub name: Option<String>,
pub modified: Option<String>,
pub flags: Option<AnnotFlags>,
pub opacity: Option<f32>,
}Expand description
Optional dictionary fields common to every annotation subtype.
Applied when writing via add_annotation / AnnotWrite.
/F defaults to AnnotFlags::PRINT when Self::flags is None.
Fields§
Author / title string written as /T.
name: Option<String>Unique name written as /NM (often an application id).
modified: Option<String>Modification date written as /M (PDF date string).
flags: Option<AnnotFlags>Annotation flags written as /F. None means AnnotFlags::PRINT.
opacity: Option<f32>Constant opacity written as /CA, from 0.0 (invisible) to 1.0.
None writes no key, which a reader takes as fully opaque. The
appearance generator reads /CA into the stream’s /ExtGState, so a
written one is honoured without the caller drawing anything.
Implementations§
Source§impl AnnotMeta
impl AnnotMeta
Sets /T.
Sourcepub fn with_modified(self, modified: impl Into<String>) -> Self
pub fn with_modified(self, modified: impl Into<String>) -> Self
Sets /M to a PDF date string.
Sourcepub fn with_flags(self, flags: AnnotFlags) -> Self
pub fn with_flags(self, flags: AnnotFlags) -> Self
Sets /F annotation flags.
use pdfrum_doc::AnnotFlags;
use pdfrum_edit::AnnotMeta;
let meta = AnnotMeta::default().with_flags(AnnotFlags::PRINT | AnnotFlags::NO_ZOOM);
assert_eq!(meta.flags, Some(AnnotFlags::PRINT | AnnotFlags::NO_ZOOM));Sourcepub fn with_opacity(self, opacity: f32) -> Self
pub fn with_opacity(self, opacity: f32) -> Self
Sets /CA, the constant opacity, clamped to 0.0..=1.0 when written.
use pdfrum_edit::AnnotMeta;
assert_eq!(AnnotMeta::default().with_opacity(0.4).opacity, Some(0.4));Trait Implementations§
impl StructuralPartialEq for AnnotMeta
Auto Trait Implementations§
impl Freeze for AnnotMeta
impl RefUnwindSafe for AnnotMeta
impl Send for AnnotMeta
impl Sync for AnnotMeta
impl Unpin for AnnotMeta
impl UnsafeUnpin for AnnotMeta
impl UnwindSafe for AnnotMeta
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.