pub struct PDAnnotation {
pub rect: PDRectangle,
pub annotation_type: AnnotationType,
pub color: Option<Color>,
pub contents: Option<String>,
}Expand description
A PDF Page Annotation (/Subtype /Link, /Highlight, /Text, etc.).
Fields§
§rect: PDRectangle§annotation_type: AnnotationType§color: Option<Color>§contents: Option<String>Implementations§
Source§impl PDAnnotation
impl PDAnnotation
Sourcepub fn link(rect: PDRectangle, uri: impl Into<String>) -> Self
pub fn link(rect: PDRectangle, uri: impl Into<String>) -> Self
Creates a clickable URI web link annotation.
Sourcepub fn highlight(rect: PDRectangle, comment: Option<String>) -> Self
pub fn highlight(rect: PDRectangle, comment: Option<String>) -> Self
Creates a text highlight annotation.
Sourcepub fn attach_to_page(
&self,
page: &mut PDPage,
cos_doc: &mut COSDocument,
) -> ObjectId
pub fn attach_to_page( &self, page: &mut PDPage, cos_doc: &mut COSDocument, ) -> ObjectId
Attaches this annotation to a page dictionary and stores it in the COSDocument.
Trait Implementations§
Source§impl Clone for PDAnnotation
impl Clone for PDAnnotation
Source§fn clone(&self) -> PDAnnotation
fn clone(&self) -> PDAnnotation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PDAnnotation
impl RefUnwindSafe for PDAnnotation
impl Send for PDAnnotation
impl Sync for PDAnnotation
impl Unpin for PDAnnotation
impl UnsafeUnpin for PDAnnotation
impl UnwindSafe for PDAnnotation
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