Navigation

  • index
  • modules |
  • next |
  • previous |
  • priint:comet Python API 5.0 documentation »
  • API Reference »
  • Classes »
  • comet.CDocLink

comet.CDocLink¶

class comet.CDocLink¶

This section describes all functions for the CDocLink class.

CDocLink represents a document link between a frame and an image. It is used to query information and update or change image links in a document.

Methods¶

CDocLink.getFrame()¶

Get the owning frame of this document link.

Returns:

The owning frame of this link.

Return type:

CFrame

Available:

InDesign® comet_pdf®

Raises:

CometError – On internal error

CScript:

frame::doclink::get_frame

CDocLink.getState()¶

Get the state of this link.

Returns:

The state of this link.

  • -1 : Error

  • 0 : Link is up-to-date and available for use.

  • 1 : Link is out-of-date and needs to be updated

  • 2 : Link resource is embedded, and link is up-to-date.

  • 3 : Link resource is cached, and link is up-to-date.

  • 4 : Link resource is contained, and link is up-to-date.

  • 5 : Link resource is missing.

  • 6 : Link resource is not accessible by the user.

  • 7 : Link resource state is pending an update.

  • 8 : Link resource state cannot be determined.

Return type:

int

Available:

InDesign® comet_pdf®

Raises:

CometError – On internal error

CScript:

frame::doclink::get_state

CDocLink.getType()¶

Determine the type of a this link.

InDesign® In addition to links to images, InDesign® can create links to text frames too, use the menu Edit -> Place and Link to do that.

comet_pdf® Links to text frames are not supported by comet_pdf!

Returns:

The type of this link.

  • -1 : Error

  • 0 : Internal

  • 1 : Text Frame

  • 2 : Image

Return type:

int

Available:

InDesign® comet_pdf®

Raises:

CometError – On internal error

CScript:

frame::doclink::get_type

CDocLink.getPath()¶

Get the complete path of this link.

Returns:

The full path to the link.

The result depends on the type of the link, see getType():

  • Internal : UID of the text frame (as str), InDesign® only

  • Image : Full path to the linked image

  • Text Frame : Empty (‘’), InDesign® only

Embedded images with a reference to their original file provide the path of this original file.

Return type:

str

Available:

InDesign® comet_pdf®

Raises:

CometError – On internal error

CScript:

frame::doclink::get_path

CDocLink.update()¶

Update the link by reimporting the data. The update uses the setting last used to import the data. If this fails because the data is no longer appropriate for this import filter, the import uses the standard import code which picks a new filter.

Return type:

None

Available:

InDesign®

Raises:

CometError – On internal error

CScript:

frame::doclink::update

CDocLink.relink(path)¶

Import a new image into the link. The function behaves like CFrame.setImage() with the parameter alignment set to constants.kPlaceLikeExisting.

Parameters:

path (str) – Full path to the new image.

Return type:

None

Available:

InDesign® comet_pdf®

CScript:

frame::doclink::relink

Special methods¶

CDocLink.__repr__()¶

String representation.

Returns:

<CDocLink> Path: Path | Frame UID: Frame UID | Type: Type description | State: State description

Example¶
<CDocLink> Path: C:/Users/Leo/Desktop/DebugInfo/000.jpg | Frame UID: 1066 | Type: Image | State: Link is up-to-date and available for use

Return type:

str

Table of Contents

  • comet.CDocLink
    • comet.CDocLink
    • Methods
      • CDocLink.getFrame()
      • CDocLink.getState()
      • CDocLink.getType()
      • CDocLink.getPath()
      • CDocLink.update()
      • CDocLink.relink()
    • Special methods
      • CDocLink.__repr__()

Previous topic

comet.CDocument

Next topic

comet.CElement

This Page

  • Show Source

Quick search

© Copyright 2025, WERK II Medien- und Informationsgesellschaft mbH. Created using Sphinx 8.0.2.