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.
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
impl AnnotationUpdates
Sourcepub fn append_attachment_points(&mut self, quad: [f32; 8]) -> &mut Self
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
impl Clone for AnnotationUpdates
Source§fn clone(&self) -> AnnotationUpdates
fn clone(&self) -> AnnotationUpdates
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more