pub struct LinkObject {
pub rect: [f32; 4],
pub quad_points: Option<Vec<f32>>,
pub destination: Option<Destination>,
pub action: Option<Action>,
pub annotation_index: usize,
}Expand description
A typed view of a link annotation for introspection.
Wraps a reference to an Annotation of subtype Link and provides
the upstream FPDFLink_* API surface: quad-point access, destination,
and action retrieval.
Obtain via find_link_at_position or collect_links.
Fields§
§rect: [f32; 4]Annotation rectangle [x1, y1, x2, y2].
quad_points: Option<Vec<f32>>QuadPoints (flat array of 8-float groups), if present.
destination: Option<Destination>The destination, if specified via /Dest.
action: Option<Action>The action, if specified via /A.
annotation_index: usizeIndex of this annotation in the page’s annotation list.
Implementations§
Source§impl LinkObject
impl LinkObject
Sourcepub fn quad_point_count(&self) -> usize
pub fn quad_point_count(&self) -> usize
Returns the number of quad-point groups (quadrilaterals) on this link.
Each group is 8 floats [x1,y1, x2,y2, x3,y3, x4,y4].
Corresponds to FPDFLink_CountQuadPoints.
Sourcepub fn link_count_quad_points(&self) -> usize
pub fn link_count_quad_points(&self) -> usize
ADR-019 alias for quad_point_count().
Corresponds to FPDFLink_CountQuadPoints.
Sourcepub fn count_quad_points(&self) -> usize
👎Deprecated since 0.1.0: use link_count_quad_points() or quad_point_count() instead
pub fn count_quad_points(&self) -> usize
use link_count_quad_points() or quad_point_count() instead
Deprecated: use link_count_quad_points()
or quad_point_count() instead.
Sourcepub fn quad_points_at(&self, index: usize) -> Option<[f32; 8]>
pub fn quad_points_at(&self, index: usize) -> Option<[f32; 8]>
Returns the index-th quad-point group as 8 floats, or None if
the index is out of bounds.
Corresponds to FPDFLink_GetQuadPoints.
Sourcepub fn link_get_quad_points(&self, index: usize) -> Option<[f32; 8]>
pub fn link_get_quad_points(&self, index: usize) -> Option<[f32; 8]>
Upstream-aligned alias for quad_points_at().
Corresponds to FPDFLink_GetQuadPoints.
Sourcepub fn get_quad_points(&self, index: usize) -> Option<[f32; 8]>
👎Deprecated since 0.1.0: use link_get_quad_points() or quad_points_at() instead
pub fn get_quad_points(&self, index: usize) -> Option<[f32; 8]>
use link_get_quad_points() or quad_points_at() instead
Deprecated: use link_get_quad_points()
or quad_points_at() instead.
Sourcepub fn get_quad_points_at(&self, index: usize) -> Option<[f32; 8]>
👎Deprecated since 0.1.0: use link_get_quad_points() or quad_points_at() instead
pub fn get_quad_points_at(&self, index: usize) -> Option<[f32; 8]>
use link_get_quad_points() or quad_points_at() instead
Deprecated: use link_get_quad_points()
or quad_points_at() instead.
Sourcepub fn dest(&self) -> Option<&Destination>
pub fn dest(&self) -> Option<&Destination>
Returns the link’s destination, if any.
Corresponds to FPDFLink_GetDest.
Sourcepub fn link_get_dest(&self) -> Option<&Destination>
pub fn link_get_dest(&self) -> Option<&Destination>
ADR-019 alias for dest().
Corresponds to FPDFLink_GetDest.
Sourcepub fn get_dest(&self) -> Option<&Destination>
👎Deprecated since 0.1.0: use link_get_dest() or dest() instead
pub fn get_dest(&self) -> Option<&Destination>
use link_get_dest() or dest() instead
Deprecated: use link_get_dest()
or dest() instead.
Sourcepub fn action(&self) -> Option<&Action>
pub fn action(&self) -> Option<&Action>
Returns the link’s action, if any.
Corresponds to FPDFLink_GetAction.
Sourcepub fn link_get_action(&self) -> Option<&Action>
pub fn link_get_action(&self) -> Option<&Action>
ADR-019 alias for action().
Corresponds to FPDFLink_GetAction.
Sourcepub fn get_action(&self) -> Option<&Action>
👎Deprecated since 0.1.0: use link_get_action() or action() instead
pub fn get_action(&self) -> Option<&Action>
use link_get_action() or action() instead
Deprecated: use link_get_action()
or action() instead.
Sourcepub fn rect(&self) -> [f32; 4]
pub fn rect(&self) -> [f32; 4]
Returns the link’s annotation rectangle.
Corresponds to FPDFLink_GetAnnotRect.
Sourcepub fn link_get_annot_rect(&self) -> [f32; 4]
pub fn link_get_annot_rect(&self) -> [f32; 4]
ADR-019 alias for rect().
Corresponds to FPDFLink_GetAnnotRect.
Sourcepub fn get_annot_rect(&self) -> [f32; 4]
👎Deprecated since 0.1.0: use link_get_annot_rect() or rect() instead
pub fn get_annot_rect(&self) -> [f32; 4]
use link_get_annot_rect() or rect() instead
Deprecated: use link_get_annot_rect()
or rect() instead.
Sourcepub fn annotation_index(&self) -> usize
pub fn annotation_index(&self) -> usize
Returns the index of this link annotation in the page’s annotation list.
The caller can use this index to retrieve the full Annotation via
page.annotations()[link.annotation_index()].
Corresponds to FPDFLink_GetAnnot — in PDFium this returns the
annotation handle for a link; in rpdfium the equivalent is to look up
the annotation by this index in the page’s annotation slice.
Sourcepub fn link_get_annot(&self) -> usize
pub fn link_get_annot(&self) -> usize
Upstream-aligned alias for annotation_index().
Corresponds to FPDFLink_GetAnnot.
Sourcepub fn get_annot(&self) -> usize
👎Deprecated since 0.1.0: use link_get_annot() or annotation_index() instead
pub fn get_annot(&self) -> usize
use link_get_annot() or annotation_index() instead
Deprecated: use link_get_annot()
or annotation_index() instead.
Sourcepub fn get_annotation_index(&self) -> usize
👎Deprecated since 0.1.0: use link_get_annot() or annotation_index() instead
pub fn get_annotation_index(&self) -> usize
use link_get_annot() or annotation_index() instead
Deprecated: use link_get_annot()
or annotation_index() instead.
Trait Implementations§
Source§impl Clone for LinkObject
impl Clone for LinkObject
Source§fn clone(&self) -> LinkObject
fn clone(&self) -> LinkObject
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more