pub struct Annot { /* private fields */ }Expand description
A PDF annotation backed by a dictionary object.
Implementations§
Source§impl Annot
impl Annot
Sourcepub fn from_dict(
dict: IndexMap<Vec<u8>, PdfObject>,
id: Option<ObjectId>,
) -> Self
pub fn from_dict( dict: IndexMap<Vec<u8>, PdfObject>, id: Option<ObjectId>, ) -> Self
Create an Annot from a PDF dictionary.
Sourcepub fn load(obj_num: u32, doc: &mut CosDoc) -> Result<Self>
pub fn load(obj_num: u32, doc: &mut CosDoc) -> Result<Self>
Load an annotation from a document by object number.
Sourcepub fn dict_mut(&mut self) -> &mut IndexMap<Vec<u8>, PdfObject>
pub fn dict_mut(&mut self) -> &mut IndexMap<Vec<u8>, PdfObject>
Get a mutable reference to the dictionary.
Sourcepub fn annot_type(&self) -> AnnotType
pub fn annot_type(&self) -> AnnotType
Get the annotation type.
Sourcepub fn flags(&self) -> AnnotFlags
pub fn flags(&self) -> AnnotFlags
Get the annotation flags.
Sourcepub fn set_flags(&mut self, flags: AnnotFlags)
pub fn set_flags(&mut self, flags: AnnotFlags)
Set the annotation flags.
Sourcepub fn contents(&self) -> Option<String>
pub fn contents(&self) -> Option<String>
Get the contents (text displayed for the annotation or alternate description).
Sourcepub fn set_contents(&mut self, text: &str)
pub fn set_contents(&mut self, text: &str)
Set the annotation contents.
Sourcepub fn modified_date(&self) -> Option<PdfDate>
pub fn modified_date(&self) -> Option<PdfDate>
Get the modification date.
Sourcepub fn color(&self) -> Option<ColorPt>
pub fn color(&self) -> Option<ColorPt>
Get the color (used for border, background, or title bar).
Sourcepub fn opacity(&self) -> f64
pub fn opacity(&self) -> f64
Get the opacity (0.0 = transparent, 1.0 = opaque) — markup annotations only.
Sourcepub fn creation_date(&self) -> Option<PdfDate>
pub fn creation_date(&self) -> Option<PdfDate>
Get the creation date — markup annotations only.
Sourcepub fn popup(&self) -> Option<ObjectId>
pub fn popup(&self) -> Option<ObjectId>
Get the popup annotation reference — markup annotations only.
Sourcepub fn to_pdf_object(&self) -> PdfObject
pub fn to_pdf_object(&self) -> PdfObject
Convert to a PdfObject::Dict for saving.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Annot
impl RefUnwindSafe for Annot
impl Send for Annot
impl Sync for Annot
impl Unpin for Annot
impl UnsafeUnpin for Annot
impl UnwindSafe for Annot
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