comet.CHyperlinkDestination¶
- class comet.CHyperlinkDestination¶
Methods¶
- CHyperlinkDestination.isValid()¶
Determine whether the hyperlink destination is still valid and exists
- Returns:
Whether the hyperlink destination is still valid and exists
- Return type:
- Available:
InDesign® comet_pdf®
- CScript:
- CHyperlinkDestination.getDocument()¶
Get the document the destination belongs to.
- Returns:
The owning document
- Return type:
- Raises:
CometError – When the destination is not valid
- Available:
InDesign® comet_pdf®
- CHyperlinkDestination.getType()¶
Get the type of the destination.
- Returns:
The destination type.
0 : Undefined
1 : URL
2 : External File
3 : Mail (comet_pdf only). InDesign® returns 1 (URL) here too.
4 : Page
5 : Text Anchor
8 : Named Destination (comet_pdf only)
- Return type:
- Raises:
CometError – When the destination is not valid
- Available:
InDesign® comet_pdf®
- CScript:
- CHyperlinkDestination.getName()¶
Get the name of the destination.
This can be useful when the destination is a text anchor or named destination.
- Returns:
The name of the destination.
- Return type:
- Raises:
CometError – When the destination is not valid
- Available:
InDesign® comet_pdf®
- CScript:
- CHyperlinkDestination.getPageIndex()¶
Get the page index the destination points to.
- Returns:
The target page index
- Return type:
- Raises:
TypeError – When the destination does not point to a page
CometError – When the destination is not valid
- Available:
InDesign® comet_pdf®
- CHyperlinkDestination.getURL()¶
Get the target URL the destination points to.
- Returns:
The target URL
- Return type:
- Raises:
TypeError – When the destination does not point to an URL
CometError – When the destination is not valid
- Available:
InDesign® comet_pdf®
- CHyperlinkDestination.getTextAnchor()¶
Get the text anchor in the target text model the destination points to.
- Returns:
The target anchor information.
Tuple containing:
CTextModel
: Text modelint
: Index
- Return type:
- Raises:
TypeError – When the destination does not point to a text anchor
CometError – When the destination is not valid
- Available:
InDesign®
Special methods¶
- CHyperlinkDestination.__repr__()¶
String representation.
- Returns:
For
getType()
== 4 (Page):<CHyperlinkDestination> Type: Page | Page: Page index
For
getType()
== 5 (Text anchor) || 6 (Named Destination):<CHyperlinkDestination> Type: Type: Type | Destination: Destination name
else:
<CHyperlinkDestination> Type: Type: Type | Destination: Destination URL
<CHyperlinkDestination> Type: Page | Page: 2 <CHyperlinkDestination> Type: Text Anchor | Destination: Anker 1 <CHyperlinkDestination> Type: URL | Destination: http://www.priint.com
- Return type: