Link
Represents a pointer to somewhere (this document, other documents, the internet). Links exist per document page, and they are forward-chained to each other, starting from an initial link which is accessible by the Page.firstLink property.
There is a parent-child relationship between a link and its page. If the page object becomes unusable (closed document, any document structure change, etc.), then so does every of its existing link objects - an exception is raised saying that the object is “orphaned”, whenever a link property or method is accessed.
| Attribute | Short Description |
|---|---|
Link.rect |
clickable area in untransformed coordinates. |
Link.uri |
link destination |
Link.isExternal |
external link destination? |
Link.next |
points to next link |
Link.dest |
points to link destination details |
Class API
-
class
Link -
rect The area that can be clicked in untransformed coordinates.
Type: Rect
-
isExternal A bool specifying whether the link target is outside of the current document.
Type: bool
-
uri A string specifying the link target. The meaning of this property should be evaluated in conjunction with property
isExternal. The value may beNone, in which caseisExternal == False. Ifuristarts withfile://,mailto:, or an internet resource name,isExternalisTrue. In all other casesisExternal == Falseanduripoints to an internal location. In case of PDF documents, this should either be#nnnnto indicate a 1-based (!) page numbernnnn, or a named location. The format varies for other document types, e.g.uri = '../FixedDoc.fdoc#PG_2_LNK_1'for page number 2 (1-based) in an XPS document.Type: str
-
next The next
LinkorNoneType: Link
-
dest The link destination details object.
Type: linkDest
-