comet.CHyperlink¶
- class comet.CHyperlink¶
Methods¶
- CHyperlink.isValid()¶
Determine whether this hyperlink destination is still valid and exists.
- Returns
Whether this hyperlink is still valid and exists
- Return type
- Available
- CScript
- CHyperlink.getType()¶
Determine the type of the hyperlink.
- Returns
The type of the hyperlink
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 hyperlink is not valid
- Available
- CScript
- CHyperlink.getDocument()¶
Get the document this link belongs to.
- Returns
The owning document
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CHyperlink.getSource()¶
Get the source attached to this link.
- Returns
The source of this link
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CHyperlink.getDestination()¶
Get the destination this hyperlink points to.
- Returns
The target destination
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.getName()¶
Determine the name of the hyperlink.
- Returns
The name of the hyperlink
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.setName(name)¶
Set the name of the hyperlink.
- Parameters
name (str) – The new name
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter name is empty
When the hyperlink is not valid
On internal error
- Available
- CScript
- CHyperlink.getVisible()¶
Determine whether the hyperlink border is visible.
- Returns
Whether the hyperlink is visible
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.setVisible(visible)¶
Set the border visibility of the hyperlink.
- Parameters
visible (bool) – The new visibility state
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.getColor()¶
Get the color of the hyperlink border.
- Returns
The color of the hyperlink border
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.setColor(color)¶
Set the color of the hyperlink border.
- Parameters
color –
The new hyperlink border color.
The parameter type can be:
- Return type
- Raises
TypeError – When parameter types are invalid
When the hyperlink is not valid
On internal error
- Available
- CScript
- CHyperlink.getBorderWidth()¶
Get the width of the hyperlink border.
- Returns
The width setting of the border
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.setBorderWidth(width)¶
Set the width of the hyperlink border.
- Parameters
width (int) – The width setting
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter width has invalid value
When the hyperlink is not valid
On internal error
- Available
- CScript
- CHyperlink.getHilight()¶
Get the hilight state of the hyperlink.
The hilight state is not used in InDesign® , it only matters when the file is exported to PDF.
To change the visibility of the hyperlink, please use
setVisible()
- Returns
The hilight state
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.setHilight(hilight)¶
Set the hilight state of the hyperlink.
The hilight state is not used in InDesign® , it only matters when the file is exported to PDF.
To change the visibility of the hyperlink, please use
setVisible()
- Parameters
hilight (int) – The new hilight state
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter hilight has invalid value
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.getOutlineStyle()¶
Get the outline style of the hyperlink.
- Returns
The outline style of the hyperlink
0: Solid
1: Dashed
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CHyperlink.setOutlineStyle(style)¶
Set the outline style of the hyperlink.
- Parameters
style (int) –
The new outline style
0: Solid
1: Dashed
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter style has invalid value
CometError – When the hyperlink is not valid
- Available
- CScript
- CHyperlink.remove()¶
Remove this hyperlink from the document.
The object will be left in an invalid state.
- Return type
- Raises
CometError – When the hyperlink is not valid
- Available
- CScript