Skip to main content

LinkObject

Struct LinkObject 

Source
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: usize

Index of this annotation in the page’s annotation list.

Implementations§

Source§

impl LinkObject

Source

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.

ADR-019 alias for quad_point_count().

Corresponds to FPDFLink_CountQuadPoints.

Source

pub fn count_quad_points(&self) -> usize

👎Deprecated since 0.1.0:

use link_count_quad_points() or quad_point_count() instead

Deprecated: use link_count_quad_points() or quad_point_count() instead.

Source

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.

Upstream-aligned alias for quad_points_at().

Corresponds to FPDFLink_GetQuadPoints.

Source

pub 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

Deprecated: use link_get_quad_points() or quad_points_at() instead.

Source

pub 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

Deprecated: use link_get_quad_points() or quad_points_at() instead.

Source

pub fn dest(&self) -> Option<&Destination>

Returns the link’s destination, if any.

Corresponds to FPDFLink_GetDest.

ADR-019 alias for dest().

Corresponds to FPDFLink_GetDest.

Source

pub fn get_dest(&self) -> Option<&Destination>

👎Deprecated since 0.1.0:

use link_get_dest() or dest() instead

Deprecated: use link_get_dest() or dest() instead.

Source

pub fn action(&self) -> Option<&Action>

Returns the link’s action, if any.

Corresponds to FPDFLink_GetAction.

ADR-019 alias for action().

Corresponds to FPDFLink_GetAction.

Source

pub fn get_action(&self) -> Option<&Action>

👎Deprecated since 0.1.0:

use link_get_action() or action() instead

Deprecated: use link_get_action() or action() instead.

Source

pub fn rect(&self) -> [f32; 4]

Returns the link’s annotation rectangle.

Corresponds to FPDFLink_GetAnnotRect.

ADR-019 alias for rect().

Corresponds to FPDFLink_GetAnnotRect.

Source

pub fn get_annot_rect(&self) -> [f32; 4]

👎Deprecated since 0.1.0:

use link_get_annot_rect() or rect() instead

Deprecated: use link_get_annot_rect() or rect() instead.

Source

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.

Upstream-aligned alias for annotation_index().

Corresponds to FPDFLink_GetAnnot.

Source

pub fn get_annot(&self) -> usize

👎Deprecated since 0.1.0:

use link_get_annot() or annotation_index() instead

Deprecated: use link_get_annot() or annotation_index() instead.

Source

pub fn get_annotation_index(&self) -> usize

👎Deprecated since 0.1.0:

use link_get_annot() or annotation_index() instead

Deprecated: use link_get_annot() or annotation_index() instead.

Trait Implementations§

Source§

impl Clone for LinkObject

Source§

fn clone(&self) -> LinkObject

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 LinkObject

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