Skip to main content

AnnotationUpdates

Struct AnnotationUpdates 

Source
pub struct AnnotationUpdates {
Show 15 fields pub contents: Option<String>, pub color: Option<Vec<f32>>, pub flags: Option<AnnotationFlags>, pub rect: Option<[f32; 4]>, pub open: Option<bool>, pub subject: Option<String>, pub author: Option<String>, pub border_width: Option<f32>, pub border_style: Option<(f32, f32, f32)>, pub color_rgba: Option<(u8, u8, u8, u8)>, pub attachment_points: Option<Vec<[f32; 8]>>, pub ink_list: Option<Vec<Vec<f32>>>, pub extra_string: Option<(String, String)>, pub vertices: Option<Vec<[f32; 2]>>, pub uri_action: Option<String>,
}
Expand description

Updates to apply to an existing annotation.

Fields§

§contents: Option<String>

New contents text.

§color: Option<Vec<f32>>

New color.

§flags: Option<AnnotationFlags>

New flags.

§rect: Option<[f32; 4]>

New rect.

§open: Option<bool>

Open/closed state for Text and Popup annotations (/Open).

§subject: Option<String>

Annotation subject (/Subj).

Corresponds to FPDFAnnot_SetStringValue with key /Subj.

§author: Option<String>

Annotation author/title (/T).

Corresponds to FPDFAnnot_SetStringValue with key /T.

§border_width: Option<f32>

Simple border width in points (/BS /W).

Sets the border-style dictionary width. Pass Some(0.0) to hide the border; None leaves the existing border unchanged.

Corresponds to FPDFAnnot_SetBorderWidth.

§border_style: Option<(f32, f32, f32)>

Full border triple (horizontal_radius, vertical_radius, width) written to /Border.

This takes precedence over border_width when both are set.

Corresponds to FPDFAnnot_SetBorder().

§color_rgba: Option<(u8, u8, u8, u8)>

Annotation color as (red, green, blue, alpha) in 0–255 range.

Stored as a 3-component /C array (RGB) in the PDF dictionary; the alpha channel is currently ignored (PDF does not support annotation opacity via /C).

Corresponds to FPDFAnnot_SetColor().

§attachment_points: Option<Vec<[f32; 8]>>

Attachment (quad) point groups for markup annotations.

Each element is 8 floats [x1,y1, x2,y2, x3,y3, x4,y4]. Replaces the entire /QuadPoints array.

Corresponds to FPDFAnnot_SetAttachmentPoints() (for a single group) / writing all groups at once.

§ink_list: Option<Vec<Vec<f32>>>

Ink strokes for Ink annotations.

Each inner Vec<f32> is a flat [x, y, x, y, …] sequence for one stroke. Replaces the entire /InkList array.

Corresponds to FPDFAnnot_AddInkStroke() / FPDFAnnot_RemoveInkList().

§extra_string: Option<(String, String)>

Arbitrary string value to write: (key, value).

Writes /<key> <value-as-PDF-string> into the annotation dictionary. Useful for less common keys not covered by the other fields.

Corresponds to FPDFAnnot_SetStringValue().

§vertices: Option<Vec<[f32; 2]>>

Polygon/PolyLine vertex pairs to write as /Vertices.

Each element is an [x, y] coordinate pair. Replaces the entire /Vertices array in the annotation dictionary.

Corresponds to FPDFAnnot_SetVertices().

§uri_action: Option<String>

Set a URI action on the annotation (/A << /S /URI /URI (uri) >>).

Writes an action dictionary with subtype /URI and the given URI string into the annotation’s /A entry.

Corresponds to FPDFAnnot_SetURI().

Implementations§

Source§

impl AnnotationUpdates

Source

pub fn append_attachment_points(&mut self, quad: [f32; 8]) -> &mut Self

Append a new set of attachment points (quadpoints) to the list.

If attachment_points is currently None, this initialises it to an empty list before appending. Note that once any element is set, the entire attachment-points array will be written on EditDocument::update_annotation.

§Upstream Correspondence

FPDFAnnot_AppendAttachmentPoints.

Trait Implementations§

Source§

impl Clone for AnnotationUpdates

Source§

fn clone(&self) -> AnnotationUpdates

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 AnnotationUpdates

Source§

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

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

impl Default for AnnotationUpdates

Source§

fn default() -> AnnotationUpdates

Returns the “default value” for a type. 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more