Skip to main content

Annotation

Struct Annotation 

Source
pub struct Annotation {
Show 24 fields pub object: Option<ObjRef>, pub subtype: String, pub rect: Option<Rect>, pub contents: Option<String>, pub page: Option<ObjRef>, pub name: Option<String>, pub modified: Option<String>, pub modified_date: Option<Date>, pub flags: AnnotationFlags, pub has_appearance: bool, pub appearance_state: Option<String>, pub border: Option<Border>, pub color: Option<Vec<f32>>, pub struct_parent: Option<i64>, pub optional_content: Option<ObjRef>, pub markup: Option<Markup>, pub state: Option<AnnotationState>, pub open: Option<bool>, pub icon: Option<String>, pub parent: Option<ObjRef>, pub file: Option<FileSpec>, pub destination: Option<Destination>, pub action: Option<Action>, pub additional_actions: Vec<TriggeredAction>,
}
Expand description

One annotation of a page (ISO 32000-1 §12.5.2, Table 164), with the entries of the subtypes pdfboss reads beyond the common ones: the markup entries (§12.5.6.2), a reply’s state (§12.5.6.3), a text or pop-up annotation’s open flag and icon, a link’s destination (§12.5.6.5), an attachment’s file (§12.5.6.15), and the /A and /AA actions (§12.6).

Fields§

§object: Option<ObjRef>

The dictionary’s reference in the page’s /Annots; None for a direct dictionary.

§subtype: String

/Subtype, as written.

§rect: Option<Rect>

/Rect, normalized; None when the entry is missing or malformed.

§contents: Option<String>

/Contents: the annotation’s text, or an alternate description.

§page: Option<ObjRef>

/P: the page the annotation belongs to, by reference.

§name: Option<String>

/NM: the name unique among the page’s annotations.

§modified: Option<String>

/M: when the annotation last changed, as written.

§modified_date: Option<Date>

/M parsed as a date (§7.9.4); None when it is in another format.

§flags: AnnotationFlags

/F, 0 when absent.

§has_appearance: bool

Whether an /AP dictionary with a normal appearance is present.

§appearance_state: Option<String>

/AS: the appearance state that picks the appearance stream.

§border: Option<Border>

/Border, as written; None when absent (the clause’s default is [0 0 1]) or malformed.

§color: Option<Vec<f32>>

/C: the colour of the icon background, pop-up title bar or link border, 0 (transparent), 1, 3 or 4 components as written.

§struct_parent: Option<i64>

/StructParent: the key under which the structure tree’s parent tree lists the annotation (§14.7.4.4).

§optional_content: Option<ObjRef>

/OC: the optional content group or membership dictionary that controls the annotation’s visibility, by reference.

§markup: Option<Markup>

The Table 170 entries; Some for the markup subtypes of Table 169.

§state: Option<AnnotationState>

The state a text annotation sets on the annotation it replies to; Some when /StateModel or /State is present.

§open: Option<bool>

/Open of a text or pop-up annotation.

§icon: Option<String>

/Name: the icon an annotation shows without an appearance stream, as written; text, file attachment and sound annotations name one.

§parent: Option<ObjRef>

/Parent: the markup annotation a pop-up belongs to, by reference.

§file: Option<FileSpec>

/FS: the file a file attachment annotation carries.

§destination: Option<Destination>

A link’s /Dest, explicit or looked up by name.

§action: Option<Action>

/A: the action performed when the annotation is activated, with its /Next chain.

§additional_actions: Vec<TriggeredAction>

/AA: the actions the annotation’s trigger events fire, in the order of Tables 194 and 196.

Trait Implementations§

Source§

impl Clone for Annotation

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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
Source§

impl PartialEq for Annotation

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Annotation

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.