Skip to main content

CaretAnnotation

Struct CaretAnnotation 

Source
pub struct CaretAnnotation {
    pub rect: Rect,
    pub symbol: CaretSymbol,
    pub rd: Option<(f64, f64, f64, f64)>,
    pub contents: Option<String>,
    pub author: Option<String>,
    pub subject: Option<String>,
    pub color: Option<AnnotationColor>,
    pub flags: AnnotationFlags,
}
Expand description

A Caret annotation per PDF spec Section 12.5.6.11.

Caret annotations mark a position in the document text where content should be inserted or where a correction is needed.

Fields§

§rect: Rect

Bounding rectangle for the caret

§symbol: CaretSymbol

Symbol to display (None or Paragraph)

§rd: Option<(f64, f64, f64, f64)>

Optional rectangle difference for the caret

§contents: Option<String>

Contents/comment

§author: Option<String>

Author

§subject: Option<String>

Subject

§color: Option<AnnotationColor>

Color

§flags: AnnotationFlags

Annotation flags

Implementations§

Source§

impl CaretAnnotation

Source

pub fn new(rect: Rect) -> Self

Create a new caret annotation.

Source

pub fn paragraph(rect: Rect) -> Self

Create a caret with paragraph symbol.

Source

pub fn with_symbol(self, symbol: CaretSymbol) -> Self

Set the caret symbol.

Source

pub fn with_rd(self, left: f64, bottom: f64, right: f64, top: f64) -> Self

Set the rectangle difference (RD).

Source

pub fn with_contents(self, contents: impl Into<String>) -> Self

Set contents/comment.

Source

pub fn with_author(self, author: impl Into<String>) -> Self

Set the author.

Source

pub fn with_subject(self, subject: impl Into<String>) -> Self

Set the subject.

Source

pub fn with_color(self, color: AnnotationColor) -> Self

Set the color.

Source

pub fn with_flags(self, flags: AnnotationFlags) -> Self

Set annotation flags.

Source

pub fn build(&self, _page_refs: &[ObjectRef]) -> HashMap<String, Object>

Build the annotation dictionary.

Source

pub fn rect(&self) -> Rect

Get the bounding rectangle.

Trait Implementations§

Source§

impl Clone for CaretAnnotation

Source§

fn clone(&self) -> CaretAnnotation

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CaretAnnotation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CaretAnnotation

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<CaretAnnotation> for Annotation

Source§

fn from(caret: CaretAnnotation) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,