pub struct LinkSpec { /* private fields */ }Expand description
A link annotation (/Subtype /Link).
The action is required, so it is taken at construction; the constructors
mirror AnnotSpec’s link family.
use kurbo::Rect;
use pdfrum_edit::{AnnotLinkHighlight, AnnotSpec, LinkSpec};
let spec: AnnotSpec = LinkSpec::uri(Rect::new(0.0, 0.0, 50.0, 10.0), "https://example.com")
.highlight(AnnotLinkHighlight::Outline)
.into();Implementations§
Source§impl LinkSpec
impl LinkSpec
Sourcepub fn new(rect: Rect, action: AnnotLinkAction) -> Self
pub fn new(rect: Rect, action: AnnotLinkAction) -> Self
A link at rect running action.
Sourcepub fn goto(rect: Rect, page: ObjRef, view: AnnotGoToView) -> Self
pub fn goto(rect: Rect, page: ObjRef, view: AnnotGoToView) -> Self
A link jumping to page in this document.
Sourcepub fn named(
rect: Rect,
name: impl Into<String>,
page: ObjRef,
view: AnnotGoToView,
) -> Self
pub fn named( rect: Rect, name: impl Into<String>, page: ObjRef, view: AnnotGoToView, ) -> Self
A link to a named destination, registering name on write.
Sourcepub fn named_existing(rect: Rect, name: impl Into<String>) -> Self
pub fn named_existing(rect: Rect, name: impl Into<String>) -> Self
A link to a destination the document already names.
Sourcepub fn goto_r(
rect: Rect,
file: impl Into<String>,
page: i64,
view: AnnotGoToView,
) -> Self
pub fn goto_r( rect: Rect, file: impl Into<String>, page: i64, view: AnnotGoToView, ) -> Self
A link into another file, at a page number and view.
Sourcepub fn goto_r_named(
rect: Rect,
file: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn goto_r_named( rect: Rect, file: impl Into<String>, name: impl Into<String>, ) -> Self
A link into another file, at a destination that file names.
Sourcepub fn launch(rect: Rect, file: impl Into<String>) -> Self
pub fn launch(rect: Rect, file: impl Into<String>) -> Self
A link that launches a file or application.
Sourcepub fn border(self, border: AnnotBorder) -> Self
pub fn border(self, border: AnnotBorder) -> Self
Sets /BS width and style.
Sourcepub fn highlight(self, highlight: AnnotLinkHighlight) -> Self
pub fn highlight(self, highlight: AnnotLinkHighlight) -> Self
Sets /H, the viewer’s click feedback. Defaults to Invert.
Source§impl LinkSpec
impl LinkSpec
A link annotation.
Sets /T, the author.
Sourcepub fn name(self, name: impl Into<String>) -> AnnotWrite
pub fn name(self, name: impl Into<String>) -> AnnotWrite
A link annotation.
Sets /NM, the annotation’s unique name.
Sourcepub fn modified(self, modified: impl Into<String>) -> AnnotWrite
pub fn modified(self, modified: impl Into<String>) -> AnnotWrite
A link annotation.
Sets /M, the modification date.
Sourcepub fn flags(self, flags: AnnotFlags) -> AnnotWrite
pub fn flags(self, flags: AnnotFlags) -> AnnotWrite
A link annotation.
Sets /F, the annotation flags.
Sourcepub fn meta(self, meta: AnnotMeta) -> AnnotWrite
pub fn meta(self, meta: AnnotMeta) -> AnnotWrite
A link annotation.
Sets every metadata field at once.