Skip to main content

Annotation

Struct Annotation 

Source
pub struct Annotation {
Show 25 fields pub annotation_type: String, pub subtype: Option<String>, pub subtype_enum: AnnotationSubtype, pub contents: Option<String>, pub rect: Option<[f64; 4]>, pub author: Option<String>, pub creation_date: Option<String>, pub modification_date: Option<String>, pub subject: Option<String>, pub destination: Option<LinkDestination>, pub action: Option<LinkAction>, pub quad_points: Option<Vec<[f64; 8]>>, pub color: Option<Vec<f64>>, pub opacity: Option<f64>, pub flags: AnnotationFlags, pub border: Option<[f64; 3]>, pub interior_color: Option<Vec<f64>>, pub field_type: Option<WidgetFieldType>, pub field_name: Option<String>, pub field_value: Option<String>, pub default_value: Option<String>, pub field_flags: Option<u32>, pub options: Option<Vec<String>>, pub appearance_state: Option<String>, pub raw_dict: Option<HashMap<String, Object>>,
}
Expand description

A PDF annotation.

Represents all PDF annotation types per ISO 32000-1:2008, Section 12.5.

Fields§

§annotation_type: String

Type of annotation (always “Annot” for annotations)

§subtype: Option<String>

Annotation subtype (Text, Highlight, Link, etc.)

§subtype_enum: AnnotationSubtype

Parsed annotation subtype enum

§contents: Option<String>

Text contents of the annotation

§rect: Option<[f64; 4]>

Rectangle bounds [x1, y1, x2, y2]

§author: Option<String>

Author/creator of the annotation (T entry)

§creation_date: Option<String>

Creation date

§modification_date: Option<String>

Modification date (M entry)

§subject: Option<String>

Subject of the annotation

§destination: Option<LinkDestination>

Link destination (for Link annotations) PDF Spec: ISO 32000-1:2008, Section 12.3.2 - Destinations

§action: Option<LinkAction>

Link action (for Link annotations) PDF Spec: ISO 32000-1:2008, Section 12.6 - Actions

§quad_points: Option<Vec<[f64; 8]>>

QuadPoints for text markup annotations (Highlight, Underline, StrikeOut, Squiggly) Each quad is 8 values: x1,y1, x2,y2, x3,y3, x4,y4 PDF Spec: ISO 32000-1:2008, Section 12.5.6.10

§color: Option<Vec<f64>>

Color array (C entry) - RGB or other color space

§opacity: Option<f64>

Opacity (CA entry) - 0.0 to 1.0

§flags: AnnotationFlags

Annotation flags (F entry)

§border: Option<[f64; 3]>

Border style array (Border entry)

§interior_color: Option<Vec<f64>>

Interior color for closed shapes (IC entry)

§field_type: Option<WidgetFieldType>

Field type for Widget annotations (FT entry: Btn, Tx, Ch, Sig)

§field_name: Option<String>

Field name for Widget annotations (T entry) Note: This is different from author (also T entry) for other annotation types

§field_value: Option<String>

Field value for Widget annotations (V entry)

§default_value: Option<String>

Default value for Widget annotations (DV entry)

§field_flags: Option<u32>

Field flags for Widget annotations (Ff entry)

§options: Option<Vec<String>>

Options for choice fields (Opt entry)

§appearance_state: Option<String>

Appearance state for checkboxes/radios (AS entry)

§raw_dict: Option<HashMap<String, Object>>

Raw annotation dictionary for preserving unknown properties during round-trip.

This contains the complete original PDF dictionary, enabling faithful preservation of properties that aren’t explicitly parsed (appearance streams, popup references, vendor-specific extensions, etc.).

Trait Implementations§

Source§

impl Clone for Annotation

Source§

fn clone(&self) -> Annotation

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 Annotation

Source§

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

Formats the value using the given formatter. Read more

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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,