Link#
Link objects contain information about page links. To create a link on a page see the createLink()
method.
- getBounds()#
Returns a rectangle describing the link’s location on the page.
- Returns:
Rect.
EXAMPLE
var rect = link.getBounds();
- setBounds(rect: Rect)#
Sets the bounds for the link’s location on the page.
- Parameters:
rect – Rect.
- getURI()#
Returns a string URI describing the link’s destination. If
isExternal()
returns true, this is a URI for a suitable browser, if it returns false pass it toresolveLink()
to access to the destination page in the document.- Returns:
string
.
EXAMPLE
var uri = link.getURI();
- setURI(uri: string)#
Sets the URI for the link’s destination. To create links to other pages within the document see the
formatLinkURI()
method.- Parameters:
uri –
string
.
- isExternal()#
Returns a boolean indicating if the link is external or not. If the link URI has a valid scheme followed by
:
(e.g.https://example.com
,mailto:test@example.com
) then it considered to be external.- Returns:
boolean
.
EXAMPLE
var isExternal = link.isExternal();
Code samples
Code samples are in TypeScript and assume that the following requirements are defined in your TypeScript file header as follows:
import * as fs from "fs"
import * as mupdfjs from "mupdf/mupdfjs"