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

bool

Available

CScript

hyperlink::is_valid

CHyperlinkDestination.getDocument()

Get the document the destination belongs to.

Returns

The owning document

Return type

CDocument

Raises

CometError – When the destination is not valid

Available

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

int

Raises

CometError – When the destination is not valid

Available

CScript

hyperlink::type

CHyperlinkDestination.getPageIndex()

Get the page index the destination points to.

Returns

The target page index

Return type

int

Raises
  • TypeError – When the destination does not point to a page

  • CometError – When the destination is not valid

Available

CHyperlinkDestination.getURL()

Get the target url the destination points to.

Returns

The target URL

Return type

str

Raises
  • TypeError – When the destination does not point to a page

  • CometError – When the destination is not valid

Available

CHyperlinkDestination.getTextAnchor()

Get the text anchor in the target text model the destination points to.

Returns

The target anchor information.

Tuple containing:

Return type

tuple[CTextModel, int]

Raises
  • TypeError – When the destination does not point to a text anchor

  • CometError – When the destination is not valid

Available